I am trying to find the different between the start time and end time of a transaction.
I am using the sample log file as below..
2022-07-17T12:36:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : Start id : 897agsh: WiresActor created for 301
2022-07-17T12:38:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : 301started : did something 301
2022-07-17T12:39:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : 301started : logged something 301
2022-07-17T12:40:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : 301started : parked in to sideway 301
2022-07-17T12:42:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : 301started : blocked for sometime 301
2022-07-17T12:44:30.3081415Z Info 38 [xxx.frame.logging.serviceCols] ["Level3"] : Wires-301 : End id : 897agsh : aslkjalksjlkjas 301
My intention is to read this log and find the difference of the timestamps. Bolded are the Unique Ids for this sample transaction.
My config file looks as below:
input {
file {
path => "C:/tools/logstash-8.3.1/config/logs/vv.log"
start_position => beginning
sincedb_path => "C:/tools/logstash-8.3.1/config/logs/level_sincedb"
}
}
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{DATA:loglevel} %{DATA:codeline} [%{DATA:framework}.<>c] ["%{DATA:level}"] : %{DATA:symbot} : Start id : %{DATA:id} :" }
add_tag => "transactionstarted"
}
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{DATA:loglevel} %{DATA:codeline} [%{DATA:framework}] ["%{DATA:level}"] : %{DATA:wire} : End id : %{DATA:id}:" }
add_tag => "transactionended"
}
elapsed {
start_tag => "transactionstarted"
end_tag => "transactionended"
unique_id_field => "id"
new_event_on_match => true
}
date {
match => [ "timestamp", ISO8601 ]
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
I can see the logs in the Kibana but not seeing the elapsed.Time or any other elapsed related fields.
Am I missing something here?