Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event timeout: Not able to get information fields from start event #5

Open
Tigzy opened this issue Nov 25, 2014 · 1 comment
Open

Comments

@Tigzy
Copy link

Tigzy commented Nov 25, 2014

Hello :)

Considering the following configuration:

filter {
  grok {
    match => ["message", "STARTING TASK: (?<task_id>.*)"]
    add_tag => [ "TaskStarted" ]
  }
  grok {
    match => ["message", "ENDING TASK: (?<task_id>.*)"]
    add_tag => [ "TaskTerminated"]
  }
  elapsed {
    start_tag => "TaskStarted"
    end_tag => "TaskTerminated"
    unique_id_field => "task_id"
  }
}

When we send the following event:

{
  "message":"STARTING TASK: some_id",
  "foo":"bar
}

and we get a timeout, a timeout event is generated like that:

{
  "tags":"elapsed",
  "task_id": "some_id"
}

but we cannot access the field named "foo" to restore its value in that timeout event. This is very useful because except the task_id, we don't have any way to retrieve which event failed.
Could be good to retrieve those fields with the add_field syntax, like:

elapsed {
    timeout_add_field => { 
      "foo" => "%{foo}"
    }
  }

Alternatively, we could chose which fields to restore from the start event, or just restore them all...

@jsvd
Copy link
Member

jsvd commented Sep 4, 2015

A simple way of implementing this would be through a :include_start_event_on_timeout => true (false by default), that adds a metadata field like
timeout_event["[@metadata][start_event]"] = start_event.to_hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants