NOOB here. Trying to assign a date that I have constructed from other fields in a csv to @timestamp. The field that is concatenated shows up in the imported data but I can get it into the @timestamp field. Here is the conf file segment.
Thanks for any advice you may be able to provide.
-Mark
filter {
if [type] == "l2tcsv" {
csv {
separator => ","
quote_char => "ª" # workaround: don't use a quote character as " gives issues if the field contains a "
columns => ["date","time","timezone","short"]
}
if [date] == "date" {
drop {} # drop the first line that contains the column names
}
mutate { merge => ["date", "time"] } # merge and join need to be in separate mutates
mutate { merge => ["date", "timezone"] } # merge and join need to be in separate mutates
mutate { join => ["date", " "] } # merge and join need to be in separate mutates
date {
match => ["date", "MM/dd/YYYY HH:mm:ss z" ]
target => "date"
}
}
}
What I get is two separate fields:
@timestamp - the date load time
date - which is the concatenation of the date, time, and timezone. I want that value in @timestamp
Use a translate filter to, er, translate the time zone names into time zone offsets that the date filter accepts.
Put the time zone name in a field of its own and reference it in the timezone option of the date filter. This assumes that the time zone names being used are unambiguous and acceptable to the date filter (the filter documentation links to a table of supported time zone names).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.