Hi all,
I done a bit of rooting around google but can't find any definitive answers, so i decided to humble myself and request help directly.
The problem i have is that, like many incoming messages, my log entry contains a timestamp field, here's an example message:
spc01ws14 sales 2020-12-10 09:15:11,909 INFO UIRequest runLifecycleSteps (102 ms) location=PolicyFile; Sources='TabBar/PolicyTab/PolicyTab_PolicyRetrievalItem_widget/PolicyTab_PolicyRetrievalItem_Button'
The datetime format seems to comply with ISO8601 so i use the following regular expression to parse my message in a grok block:
`grok {
match => {
"message" => "(?<serverid>([a-z]{3}[0-9]{2}[a-z]{2}[0-9]{2}){0,1})\s+(?<username>([A-Za-z0-9.@\-]*){0,1})\s+(%{TIMESTAMP_ISO8601:logdate})?\s+(%{LOGLEVEL:loglevel})\s+(?<classname>([^\s]+){0,1})\s+%{GREEDYDATA:body}"
}
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
tag_on_failure => [ "_not_interested" ]
}`
The problem i have is that the logdate field comes through to Kibana as a string so i cannot apply between filters to this field.
I read that this is expected behaviour, but i can't find an easy answer to solve the problem i have.
I would also like to flip the fields so the "@timestamp" field contains the current logdate information - is that as easy as changing the grok to (%{TIMESTAMP_ISO8601:@timestamp}) ?
Many thanks in advance.