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

Convert single quoted json log to double quoted before input #34450

Closed
dfgh012316 opened this issue Feb 2, 2023 · 2 comments
Closed

Convert single quoted json log to double quoted before input #34450

dfgh012316 opened this issue Feb 2, 2023 · 2 comments
Labels
needs_team Indicates that the issue/PR needs a Team:* label Stalled

Comments

@dfgh012316
Copy link

Describe the enhancement:

I have some difficulty getting azure platform log using azure module .

The log format of the Azure function is inconsistent with the format of other platform logs, and it is an illegal json string.

{
"time": "2022-09-10T10:27:45Z",
"resourceId": "/SUBSCRIPTIONS/xxx/RESOURCEGROUPS/xxx/PROVIDERS/MICROSOFT.WEB/SITES/xxx",
"category": "FunctionAppLogs",
"operationName": "Microsoft.Web/sites/functions/log",
"level": "Error",
"location": "West Europe",
"properties": {'appName':'xxx','roleInstance':'xxx','message':'{'level':'info','time':'2022-09-10T10:27:45.818077054Z','message':'init config'}','category':'Host.Function.Console','hostVersion':'4.10.4.4','hostInstanceId':'xxx','level':'Error','levelId':4,'processId':60}
}

Reference:

https://learn.microsoft.com/en-us/answers/questions/1001797/invalid-json-logs-produced-for-function-apps?fbclid=IwAR0eQ5SFEfJHwCc2v_sUqxZm16YhymQyW9ef2039d3tA4VpaN7d4vYFrPa8

I don’t know if different encode inputs can be processed for the same input type in filebeat.

I'm sorry if there is already a way of doing this in filebeat

Describe a specific use case for the enhancement or feature:

I expect to be able to handle it like mutate in logstash .

mutate {
gsub => [
"message", "'", '"',
"message", ": None\b", ": null",
"message", ": True\b", ": true"
]
}
json { source => "message" remove_field => [ "message" ] }

Reference:

https://discuss.elastic.co/t/logstash-convert-single-quoted-json-log-to-double-quoted/317164

Or have any other suggestions please let me know

Thanks .

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 2, 2023
@botelastic
Copy link

botelastic bot commented Feb 2, 2023

This issue doesn't have a Team:<team> label.

@botelastic
Copy link

botelastic bot commented Feb 2, 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 Feb 2, 2024
@botelastic botelastic bot closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label Stalled
Projects
None yet
Development

No branches or pull requests

1 participant