How to create multi indexes in .conf file in logstash

52 Views Asked by At

I used the following .conf file but it gives me an error. My idea was to add more conditions in filter in order to have multi index depending on the csv file.

input {
      file {
        path => "/home/aitor/RETO8/*.csv"
        start_position => "beginning"
        sincedb_path => "/dev/null"
      }
    }
filter {
      if [path] =~ "df_actualizado.csv" {
        mutate { replace => { type => "apache_access" } }
    
    
  csv {
      separator => ","
      skip_header => "true"
      columns => ['Smart_Meter_1', 'Smart_Meter_2', 'Smart_Meter_3',
       'Smart_Meter_4', 'Smart_Meter_5', 'Smart_Meter_6', 'Smart_Meter_7',
       'Smart_Meter_8', 'Smart_Meter_9', 'Smart_Meter_10', 'Smart_Meter_11']
  }
}

  output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "%{type}_indexer"
  }

stdout {}

}
1

There are 1 best solutions below

0
On BEST ANSWER

It seems that you are missing a parenthesis after the if statement, causing it to be left open.