Hi i need use millisecond into syslog file, i have commented out the "RSYSLOG_TraditionalFileFormat" template fron rsyslog.conf and now i have timestamp in RFC3339 format, i need parse this timestamp but I do not know what pattern to use.
OK thanks, works, but i have problem in kibana, i need order log per millisecond but in case of same @timestamp, syslog_timestamp not sort order
at the right is syslog_timestamp, this order is unsortable...i need same format as @timestamp (left comumn), maybe i can build a new timestamp with "mutate"? is there a less complex way to do so?
Pipeline main started
{
"message" => "2017-10-26T14:37:06.540286+02:00 some-data",
"@version" => "1",
"@timestamp" => "2017-10-26T12:37:21.522Z",
"sys_timestamp" => "2017-10-26T14:37:06.540286Z"
}
Pipeline main has been shutdown
Now i have sys_timestamp with same format of @timestamp but in kibana the log is displayed with 2 hours more, although in the json view the timestamp is correct
does not it seem a logstash problem, maybe kibana?
It looks like the year, month etc fields weren't set when the sys_timestamp field was created. Let's see all of the configuration at once. Did you try using the the TIMESTAMP_ISO8601 grok pattern?
filter {
grok {
match => [
"message",
"%{TIMESTAMP_ISO8601:sys_timestamp} %{GREEDYDATA:syslog_data}"
]
}
date {
match => [ "sys_timestamp", "ISO8601" ]
timezone => "Europe/Rome"
}
}
The resul is obviously:
Pipeline main started
{
"message" => "2017-10-26T14:37:06.540286+02:00 some-data",
"@version" => "1",
"@timestamp" => "2017-10-26T12:37:21.522Z",
"sys_timestamp" => "2017-10-26T14:37:06.540286+02:00"
}
Pipeline main has been shutdown
I this way how can convert format 2017-10-26T14:37:06.540286+02:00 in 2017-10-26T14:37:21.522Z ?
Works fine here (below). Are you sure your filters are being run? Your grok filter should either a) be successful and produce sys_timestamp and syslog_data fields or b) be unsuccessful and that the event _grokparsefailure. Right now it appears to produce only a sys_timestamp field and that doesn't make sense.
I have omitted in the example syslog_data, sorry , the field exists
If i leave sys_timestamp in this format, i see in kibana the same format like @timestamp (eg. October 26th 2017, 14:37:14.025) ?
I have omitted in the example syslog_data, sorry , the field exists
Please don't tamper with the evidence.
If i leave sys_timestamp in this format, i see in kibana the same format like @timestamp (eg. October 26th 2017, 14:37:14.025) ?
Yes, ES should detect that string as a date the next time you create an index and the automapper gets a chance to pick a mapping (existing field mappings can't be changed).
But why would you keep sys_timestamp now that you've parsed it into @timestamp and they contain the same thing?
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.