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

read json file as a whole instead of line by line #2316

Open
yosiasz opened this issue Dec 26, 2024 · 2 comments
Open

read json file as a whole instead of line by line #2316

yosiasz opened this issue Dec 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@yosiasz
Copy link

yosiasz commented Dec 26, 2024

Request

When scrapping json files, alloy reads individual lines rather than the content of the json file.

alloy sees the following json data and scrapes each data piece as one line

{
	"msec": "foo_mec",
	"connection": "vader",
	"connection_requests": "sith",
	"ssl_cipher": "mandalorian",
	"scheme": "dark",
	"request_method": "force",
	"server_protocol": "bazinga",
	"pipe": "flute",
	"gzip_ratio": "light speed"
}

It scrapes it properly when it is collapsed into one line.

{"msec":"foo_mec","connection":"vader","connection_requests":"sith","ssl_cipher":"mandalorian","scheme":"dark","request_method":"force","server_protocol":"bazinga","pipe":"flute","gzip_ratio":"light speed"}

Use case

Many systems generate json logs, or logs in json format and generally speaking they are not collapsed. Would be hard to change all of these systems to accomodate alloy.

Could there be a feature, maybe via config, to make alloy collapse the data before scrapping it?

Thanks!

@yosiasz yosiasz added the enhancement New feature or request label Dec 26, 2024
@mattdurham
Copy link
Collaborator

Can multi line in Loki.process meet this need?

@yosiasz
Copy link
Author

yosiasz commented Dec 30, 2024

Let me try that out, thanks

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

No branches or pull requests

2 participants