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

Output message as json #244

Open
kk-mats opened this issue Mar 18, 2024 · 1 comment
Open

Output message as json #244

kk-mats opened this issue Mar 18, 2024 · 1 comment
Labels
agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged

Comments

@kk-mats
Copy link

kk-mats commented Mar 18, 2024

Hi, I started to use this package in conjuction with logback-logstash-encoder for message layout.
Then I noticed that message is output being quoted as string even if it is actually json.

I suppose this is because EcsJsonSerializer.serializeFormattedMessage is always used for any message layout in EcsEncorder.
https://github.com/elastic/ecs-logging-java/blob/main/logback-ecs-encoder/src/main/java/co/elastic/logging/logback/EcsEncoder.java#L149

Currently is there any way to output message in json or do you have any plan to support such feature?

@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged labels Mar 18, 2024
@felixbarny
Copy link
Member

You could parse the JSON message in an Elasticsearch ingest pipeline. But generally, the ecs encoder is not designed to work with another JSON encoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community triage Issues and PRs that need to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants