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

Add support into the httpjson input to collect values of maps in different events #21465

Closed
jsoriano opened this issue Oct 2, 2020 · 2 comments · Fixed by #22320
Closed

Add support into the httpjson input to collect values of maps in different events #21465

jsoriano opened this issue Oct 2, 2020 · 2 comments · Fixed by #22320
Labels
discuss Issue needs further discussion. enhancement

Comments

@jsoriano
Copy link
Member

jsoriano commented Oct 2, 2020

Describe the enhancement:

httpjson input currently supports collecting a different event for each object contained in a JSON array. There are two options for that: json_objects_array, that collects the objects in an array directly as separate documents, and split_events_by, that does something similar, but adding the fields of the parent JSON object.

There are cases where multiple events are sent in a hash instead of a list. Something like this:

{
  "events": {
    "someid01": {
      "time": "2020-09-29 11:54:27",
      "action": "log in"
    },
    "someid02": {
      "time": "2020-09-29 12:43:27",
      "action": "create user"
    }
  }
}

There could be something like a json_objects_map, so with the following configuration it is able to collect events from a response like the previous one:

- type: httpjson
  json_objects_map:
    map: events
    key_field: id

Previous configuration, would collect something like these two events for the previous example:

{
  "id": "someid01",
  "time": "2020-09-29 11:54:27",
  "action": "log in"
}

{
  "id": "someid02",
  "time": "2020-09-29 12:43:27",
  "action": "create user"
}

Describe a specific use case for the enhancement or feature:

@jsoriano jsoriano added enhancement discuss Issue needs further discussion. Team:SIEM labels Oct 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@jsoriano
Copy link
Member Author

jsoriano commented Dec 7, 2020

Thanks @marc-gr! #22320 looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants