kv.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. [[kv-processor]]
  2. === KV Processor
  3. This processor helps automatically parse messages (or specific event fields) which are of the foo=bar variety.
  4. For example, if you have a log message which contains `ip=1.2.3.4 error=REFUSED`, you can parse those automatically by configuring:
  5. [source,js]
  6. --------------------------------------------------
  7. {
  8. "kv": {
  9. "field": "message",
  10. "field_split": " ",
  11. "value_split": "="
  12. }
  13. }
  14. --------------------------------------------------
  15. // NOTCONSOLE
  16. [[kv-options]]
  17. .Kv Options
  18. [options="header"]
  19. |======
  20. | Name | Required | Default | Description
  21. | `field` | yes | - | The field to be parsed
  22. | `field_split` | yes | - | Regex pattern to use for splitting key-value pairs
  23. | `value_split` | yes | - | Regex pattern to use for splitting the key from the value within a key-value pair
  24. | `target_field` | no | `null` | The field to insert the extracted keys into. Defaults to the root of the document
  25. | `include_keys` | no | `null` | List of keys to filter and insert into document. Defaults to including all keys
  26. | `exclude_keys` | no | `null` | List of keys to exclude from document
  27. | `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
  28. | `prefix` | no | `null` | Prefix to be added to extracted keys
  29. | `trim_key` | no | `null` | String of characters to trim from extracted keys
  30. | `trim_value` | no | `null` | String of characters to trim from extracted values
  31. | `strip_brackets` | no | `false` | If `true` strip brackets `()`, `<>`, `[]` as well as quotes `'` and `"` from extracted values
  32. include::common-options.asciidoc[]
  33. |======