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

Parse json by extract specify key. #16379

Open
lvhuat opened this issue Aug 8, 2024 · 0 comments
Open

Parse json by extract specify key. #16379

lvhuat opened this issue Aug 8, 2024 · 0 comments

Comments

@lvhuat
Copy link

lvhuat commented Aug 8, 2024

Hello there!
Our system generates a large amount of logs, each containing many unused fields. If we use the following json filter:

filter {
    json {
        source => "message"
        target => "parsed"
        remove_field => ["message"]
    }
}

then all unused fields will be unmarshaled into key/value pairs, which leads to significant CPU cost.
Is there any method to achieve something like this:

json {
    parse_keys => ["@timestamp", "message", "k8s_pod_namespace", "k8s_pod"]
    source => "message"
    target => "parsed"
    remove_field => ["message"]
}

This way, only the specified keys will be parsed, potentially reducing CPU usage significantly. We believe this feature would be extremely beneficial for optimizing performance in environments with large log volumes.
Thank you for considering this request!

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

No branches or pull requests

1 participant