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

Nested JSON Output #255

Closed
atze234 opened this issue Nov 24, 2023 · 1 comment
Closed

Nested JSON Output #255

atze234 opened this issue Nov 24, 2023 · 1 comment

Comments

@atze234
Copy link

atze234 commented Nov 24, 2023

Hello,

i'm parsing my logs using Grok Patterns with the fluent-plugin-grok-parser.
Having such a pattern in filter for example:

<filter matcher>
  @type parser
  key_name message
  reserve_data true
<grok>
  pattern "^%{IP:[http][request][client][ip]} %{DATA}"
</grok>
</filter>

This will create the Field "[http][request][client][ip]" in cloudwatch logs. Is it possible somehow that i can put nested JSON directly to cloudwatch?

What i expect in Cloudwatch Logs:

{
   
    "host": "myhostname",
    "message": "192.168.0.1 message-from-ip",
    "http": {
        "request": {
          "client": {
            "ip" : "192.168.0.1"
          }
        }
      }
}

But i got in cloudwatch:

{
   
    "host": "myhostname",
    "message": "192.168.0.1 message-from-ip",
    "[http][request][client][ip]": "192.168.0.1"
}

Im using the fluent-package from Debian Repository with these plugins:
fluent-plugin-cloudwatch-logs (0.14.3)
fluent-plugin-grok-parser (2.6.2)

Copy link

@atze234 this issue was automatically closed because it did not follow the issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant