Quote_char not working in csv filter logstash

I am working on the csv filter. The Separator and the Columns works fine. I came to know that the quotes_char assign the charater to every output i get. So in the quotes_char, i added a "^" string. But It doesn't made any changes to the file uploaded to ES.

Here's the logstash conf file for my cars.csv file.

input {
   file {
      path => "/home/paulsteven/log_cars/cars.csv"
      start_position => "beginning"
      sincedb_path => "/dev/null"
   }
}
filter {
    csv {
        separator => ","
 	quote_char => "^"
        columns => ["City_mpg","Classification","Driveline","Engine_Type","Fuel_Type","Height","Highway_mpg","Horsepower","Hybrid","ID","Length","Make","Model_Year","Number_of_Forward_Gears","Torque","Transmission","Width","Year"]
    }

}
output {
  elasticsearch {
    hosts => "localhost:9200"
    index => "cs24"
    document_type => "details"
  }
  stdout{}
}

The sample output loaded in terminal for only one row:
{
"Engine_Type" => "Rear-wheel drive",
"host" => "smackcoders",
"Classification" => ""Automatic",
"Transmission" => "330",
"Number_of_Forward_Gears" => "2012 BMW 7 Series",
"Model_Year" => "BMW",
"Highway_mpg" => "200",
"Hybrid" => "315",
"Make" => "94",
"Torque" => "6",
"Year" => "110",
"Width" => "6 Speed Automatic Select Shift",
"@version" => "1",
"City_mpg" => "17",
"@timestamp" => 2019-04-11T11:05:52.259Z,
"Horsepower" => "25",
"ID" => "False",
"message" => "17,"Automatic,Transmission",Rear-wheel drive,BMW 3.0L 6 cylinder 315hp 330 ft-lbs Turbo,Gasoline,200,25,315,False,2012 BMW 740Li Sedan,94,BMW,2012 BMW 7 Series,6,330,6 Speed Automatic Select Shift,110,2012",
"Height" => "Gasoline",
"path" => "/home/paulsteven/log_cars/cars.csv",
"Fuel_Type" => "BMW 3.0L 6 cylinder 315hp 330 ft-lbs Turbo",
"Length" => "2012 BMW 740Li Sedan",
"column19" => "2012",
"Driveline" => "Transmission""
}

There is no quote_char in the output instead of double quotes. Then what is the use of quote_char. Help me with some suggestions

quote_char determines how the input is parsed. It has no effect on the output. The default is double-quote, so that an input line might look like this

"Hello, world!",Foo

and that would be parsed as two columns. If your input was instead

%Hello, world!%,Foo

then you could set quote_char => "%" and that would be parsed as two columns instead of three.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.