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

json. add_error_key: false not honored #11298

Closed
ycombinator opened this issue Mar 18, 2019 · 0 comments · Fixed by #12725
Closed

json. add_error_key: false not honored #11298

ycombinator opened this issue Mar 18, 2019 · 0 comments · Fixed by #12725
Labels
bug good first issue Indicates a good issue for first-time contributors libbeat

Comments

@ycombinator
Copy link
Contributor

  • Version: master / 8.0.0
  • Operating System: Mac OS X
  • Discuss Forum URL: https://discuss.elastic.co/t/error-key-populated-even-when-explicitly-disabled/172602
  • Steps to Reproduce:
    1. Setup filebeat.yml like so:
      filebeat.inputs:
      - type: stdin
      
        enabled: true
        json.add_error_key: false
        json.overwrite_keys: true
        json.keys_under_root: true
      
      output.console:
        enabled: true
    2. Run Filebeat:
      ./filebeat -e
    3. Give it the following input on STDIN:
      { "type": 12345 }
      

Filebeat expectedly fails with this error:

ERROR   jsontransform/jsonhelper.go:76  JSON: Won't overwrite type because value is not string

However, in the event that is generated (see example below), the error field is set to an object, despite json.add_error_key being set to false in the configuration.

{"@timestamp":"2019-03-18T21:03:42.045Z","@metadata":{"beat":"filebeat","type":"_doc","version":"8.0.0"},"log":{"offset":0,"file":{"path":""}},"error":{"message":"type not overwritten (not string)","type":"json"},"input":{"type":"stdin"},"agent":{"type":"filebeat","ephemeral_id":"7e40fe2c-8d09-430e-b661-aa9773ae6c87","hostname":"Shaunaks-MBP-2","id":"51a8bb52-16b0-4129-a33b-9fba504fe6e8","version":"8.0.0"},"ecs":{"version":"1.0.0-beta2"},"host":{"name":"Shaunaks-MBP-2"}}
@kvch kvch added bug good first issue Indicates a good issue for first-time contributors libbeat labels Apr 11, 2019
olimpias added a commit to olimpias/beats that referenced this issue Jun 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Indicates a good issue for first-time contributors libbeat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants