Hi,
this is my expected result:
A new field "time_taken" which in best case calculates in "ms" the used time between the timestamp in the documents. I would like to sort them later in a table so that I can analyze which step took the longest in the log.
Here are all my data: {"@t":"2022-01-05T08:40:41.3460741Z","@mt":"No type was specified for the decima - Pastebin.com
I do not know how best to proceed now, because I would like to have a duration for each step. It can be a solution directly in Elasticsearch via a scripted field or via logstash. I also have no tags or an end date with which I can analyze what should be calculated now.
This is my longstash.conf
:
input {
beats {
port => 5044
}
tcp {
port => 5000
}
}
filter {
json {
source => "message"
}
mutate {
remove_field => ["message", "@timestamp", "@version", "host"]
}
# ruby {
# path => "/etc/logstash/filters/duration.rb"
# }
}
## Add your filters / logstash plugins configuration here
output {
elasticsearch {
hosts => "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_HTTP_PORT}"
user => "${ELASTIC_USERNAME}"
password => "${ELASTIC_PASSWORD}"
ecs_compatibility => disabled
index => "log-sup" # Create new index
#manage_template => true
#template_overwrite => true
template => "/usr/share/logstash/index-template-trace.json"
template_name => "trace"
}
}