boardman411
2015-05-22 13:51:41 UTC
Hi, I'm new to logstash and I'm trying to take the date field from a XML
Log and update the @timestamp field with the date of the log.. I can grab
the current log time using GROK.
grok {
pattern =>
"(?<logdate>[0-9]{4}[0-9]{2}[0-9]{2}\w[0-9]{2}:[0-9]{2}:[0-9]{2})"
I see 'logdate' in my output when processing the file.
"message" => "20150425T16:39:00 <stats> (Removed rest of message)
"@timestamp" => "2015-05-22T13:16:19.172Z",
"host" => "nykdsr000000680.intranet.barcapint.com",
"logdate" => "20150425T16:39:00",
What I can't seem to do, is update the @timestamp field with the logdate..
Below is my FILTER, can anyone see what I'm doing incorrect here..
filter {
grok {
pattern =>
"(?<logdate>[0-9]{4}[0-9]{2}[0-9]{2}\w[0-9]{2}:[0-9]{2}:[0-9]{2})"
}
xml {
source => "message"
target => "message_parsed"
add_tag => ["xml_parsed"]
}
date {
match => ["logdate", "yyyy-MM-dd HH:mm:ss"]
target => "@timestamp"
}
}
Is my Match syntax incorrect... Thanks for looking...
Log and update the @timestamp field with the date of the log.. I can grab
the current log time using GROK.
grok {
pattern =>
"(?<logdate>[0-9]{4}[0-9]{2}[0-9]{2}\w[0-9]{2}:[0-9]{2}:[0-9]{2})"
I see 'logdate' in my output when processing the file.
"message" => "20150425T16:39:00 <stats> (Removed rest of message)
"@timestamp" => "2015-05-22T13:16:19.172Z",
"host" => "nykdsr000000680.intranet.barcapint.com",
"logdate" => "20150425T16:39:00",
What I can't seem to do, is update the @timestamp field with the logdate..
Below is my FILTER, can anyone see what I'm doing incorrect here..
filter {
grok {
pattern =>
"(?<logdate>[0-9]{4}[0-9]{2}[0-9]{2}\w[0-9]{2}:[0-9]{2}:[0-9]{2})"
}
xml {
source => "message"
target => "message_parsed"
add_tag => ["xml_parsed"]
}
date {
match => ["logdate", "yyyy-MM-dd HH:mm:ss"]
target => "@timestamp"
}
}
Is my Match syntax incorrect... Thanks for looking...
--
Remember: if a new user has a bad time, it's a bug in logstash.
---
You received this message because you are subscribed to the Google Groups "logstash-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to logstash-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Remember: if a new user has a bad time, it's a bug in logstash.
---
You received this message because you are subscribed to the Google Groups "logstash-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to logstash-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.