Hi,
I would like to convert date in string to date in integer. In below example I would like format of "TS" to be similar to that of @timestamp
{
"type" => "perf",
.............
"@timestamp" => 2017-04-29T01:25:21.279Z,
.............
"TS" => "Fri Apr 28 16:16:29 2017"
}
My /etc/logstash/conf.d/logstash.conf has
input {
file {
path => "/var/www/html/processed/perf.csv"
type => "perf"
start_position => beginning
sincedb_path => "/dev/null"
ignore_older => 0
}
}
filter {
if [type] == "perf" {
csv {
separator => ","
columns => ['TS','CAPACITY']
convert => {
'CAPACITY' => 'integer'
}
}
date {
match => [ "TS", "dd/MMM/YYYY:HH:mm:ss Z" ]
}
}
}
output {
if [type] == "perf" {
elasticsearch {
hosts => "localhost:9200"
action => "index"
index => "lstash-%{+YYYY.MM.dd}"
}
}
stdout { codec => rubydebug }
}
I am getting following parse error and also TS not converted. Tried multiple methods mentioned in various discussions nothing worked.
{
"type" => "perf",
..........
"tags" => [
[0] "_dateparsefailure"
],
"@timestamp" => 2017-04-29T01:30:53.806Z,
..........
"TS" => "Fri Apr 28 16:13:49 2017"
}