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

Add json.* config support in the aws-cloudwatch input #26429

Closed
ndtreviv opened this issue Jun 23, 2021 · 7 comments
Closed

Add json.* config support in the aws-cloudwatch input #26429

ndtreviv opened this issue Jun 23, 2021 · 7 comments
Labels
Stalled Team:Cloud-Monitoring Label for the Cloud Monitoring team

Comments

@ndtreviv
Copy link

filbeat config:

filebeat.inputs:
  - type: aws-cloudwatch
    log_group_arn: arn:aws:logs:us-east-1:REDACTED:log-group:/ecs/REDACTED:*
    scan_frequency: 1m
    start_position: beginning
    json.keys_under_root: true
    json.add_error_key: true
    json.message_key: message

Cloudwatch logs:
Screenshot 2021-06-23 at 08 36 43

Indexed logs:

...
"message" : """{"timestamp":"2021-06-23T07:27:36.998","level":"INFO","thread":"ForkJoinPool.commonPool-worker-3","logger":"com.mycompany.myapp.RequestHandler","message":"Processing for immediate request status: Progress={jobId=REDACTED, mediaCount=100, mediaProcessed=100, status=PROCESSING, error=null, errorCount=0, started=Wed Jun 16 05:30:52 UTC 2021, finished=null, took=null}","context":"default"}""",
...

I would have expected the json.* properties to kick in, the message field (which is all json) to be parsed as json and the resulting object keys to be put on the document. This includes overwriting the message field itself with the one in the json object.
This works as expected when using a log file input.

For confirmed bugs, please report:

  • Version: 7.13.0
  • Operating System: N/A (task deployed to ECS)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 23, 2021
@kaiyan-sheng kaiyan-sheng self-assigned this Jun 23, 2021
@kaiyan-sheng kaiyan-sheng added the Team:Integrations Label for the Integrations team label Jun 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 23, 2021
@ndtreviv
Copy link
Author

In case it helps, the logging was written by a springboot application using the following logging config:

<configuration>

    <springProperty scope="context" name="log_level" source="logging.level"
                    defaultValue="info"/>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
            <layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
                <jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter" />
                <timestampFormat>${LOG_DATEFORMAT_PATTERN}</timestampFormat>
                <appendLineSeparator>true</appendLineSeparator>
            </layout>
        </encoder>

    </appender>
    <root level="${log_level}">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

@kaiyan-sheng
Copy link
Contributor

Hi @ndtreviv currently aws-cloudwatch input doesn't support the json.* options. These json options are only for log input in Filebeat. I will leave this issue open to track this enhancement. Thank you!

@kaiyan-sheng kaiyan-sheng changed the title json.* config properties don't work on the aws-cloudwatch input Add json.* config support in the aws-cloudwatch input Jul 16, 2021
@kaiyan-sheng kaiyan-sheng removed their assignment Oct 21, 2021
@jlind23 jlind23 added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Mar 28, 2022
@kaiyan-sheng kaiyan-sheng removed the Team:Integrations Label for the Integrations team label Mar 28, 2022
@ravikesarwani
Copy link

Putting it in hold for the time being. Can be looked at once we work on #23575

@botelastic
Copy link

botelastic bot commented Apr 1, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Apr 1, 2023
@ndtreviv
Copy link
Author

ndtreviv commented Apr 1, 2023

👍🏻🙏

@botelastic botelastic bot removed the Stalled label Apr 1, 2023
@botelastic
Copy link

botelastic bot commented Mar 31, 2024

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Mar 31, 2024
@botelastic botelastic bot closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stalled Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

No branches or pull requests

5 participants