Filebeat unicode json parse error

I have worked worked with json earlier, but this json output is unique, and filebeat throws error as

Error decoding JSON: invalid character 'u'

elk_filebeat     | 2021-08-01T23:33:35.056Z     ERROR   json/json.go:51 Error decoding JSON: invalid character 'u' looking for beginning of object key string

The json file is

{u'service': [{u'status': {u'started': u'2021-07-04T09:28:31.000Z', u'ldapConnectionState': u'connected', u'connectionCount': 104, u'InitiatorState': u'running', u'State': u'running'}, u'name': u'APPServ'}]}

Tried to add the encoding to see if it changes.
Filebeat config is pretty straight forward

- type: log
  enabled: true
  paths:
    - /var/log/*.log
  json.keys_under_root: true
  json.add_error_key: true
  encoding: "utf-8"

How would i go about this?

It's complaining about the u preceding the text. It's not valid json.

is there a way for filebeat to discard the 'u

Maybe try to script it using the script processor but besides that, not that I'm tracking.

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