Filebeat 7.1 UDP + JSON

I try to use such config to get data from my app. on UDP socket in JSON format.
I hope it will help to mark all fields automatically (like in GELF driver)


- type: udp
  host: "localhost:9099"
  max_message_size: 100KiB

  path: ${path.config}/modules.d/*.yml
  reload.enabled: false

  index.number_of_shards: 3

  host: ""


  hosts: [""]
    - index: "system-%{[agent.version]}-%{+yyyy.MM.dd}"
        event.module: "system"
    - index: "drupal-%{[agent.version]}-%{+yyyy.MM.dd}"

  - add_cloud_metadata: ~
  - add_host_metadata:
      netinfo.enabled: true
      cache.ttl: 5m
  - decode_json_fields:
      fields: ["message"]
      process_array: true
      max_depth: 10
      overwrite_keys: true

But I've got such kind of error in filebeat logs, could plz tell what I am doing wrong?

Private:interface {}(nil)}, Flags:0x1} (status=400):

{"type":"mapper_parsing_exception","reason":"failed to parse field [message] of type [text] in document with id 'JGNk_m0BojXHgnHnNPHC'","caused_by":{"type":"illegal_state_exception","reason":"Can't get text on a START_OBJECT at 1:366"}}

From app side for integration I use monolog, it could send valid JSON data

Hi @Serg,

can this be that the index mapping already exists as text at elasticsearch, and you are trying to use it as an object (after being JSON decoded)?

Can you retry using target element at your configuration to write to a non already mapped field?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.