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

Support YAML input #70

Open
gf-mse opened this issue Jun 24, 2019 · 8 comments
Open

Support YAML input #70

gf-mse opened this issue Jun 24, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@gf-mse
Copy link

gf-mse commented Jun 24, 2019

Just discovered this project ( which is an awesome idea, btw ); I wonder if it supports | yaml -- and if not, then how hard it would be to add that ?

@gf-mse gf-mse changed the title '| yaml' ? '| yaml' ? [ extension-request ] Jun 24, 2019
@rcoh
Copy link
Owner

rcoh commented Jun 24, 2019

It should be easy to add -- just follow the pattern of the JSON operator. Currently deeply nested structures aren't well supported, neither is accessing them -- you'd need to hack around that for now the same way JSON does, I think.

But when I add better support for nested structures YAML will get it too

@rcoh rcoh added the enhancement New feature or request label Jun 24, 2019
@rcoh rcoh changed the title '| yaml' ? [ extension-request ] Support YAML output Jun 24, 2019
@gf-mse
Copy link
Author

gf-mse commented Jun 24, 2019

My sincere apologies -- I meant a YAML parser. ( YAML output probably comes as a very natural next step, though )

@rcoh rcoh changed the title Support YAML output Support YAML input Jun 24, 2019
@rcoh rcoh added the good first issue Good for newcomers label Jun 24, 2019
@rcoh
Copy link
Owner

rcoh commented Jun 30, 2019

After a bit more thought, this may be quite tricky. Currently, things operate on a line-by-line basis. You'd need to somehow flatten your YAML structure onto a single line or significantly refactor that way input works.

@rcoh rcoh removed the good first issue Good for newcomers label Jun 30, 2019
@gf-mse
Copy link
Author

gf-mse commented Jun 30, 2019

So for json input, everything is flattened to one line first? That is, we need a plugin that converts yaml input to a sequence of json-formatted lines .. what I suppose could be an external program. Ok, I get it. Thank you.

@rcoh
Copy link
Owner

rcoh commented Jun 30, 2019

json input assumes that the entire JSON record is on one line (which is the case for most logging applications)

@rcoh
Copy link
Owner

rcoh commented Jul 6, 2019

@gf-mse are your yaml documents separated by --- or something similar? It would be easy to allow changing the document separator from \n to another string like that.

@gf-mse
Copy link
Author

gf-mse commented Jul 6, 2019

No, but it could be achieved. Worse comes to worse, I can pre-parse it and add a --- on every de-indentation, or next top-level list/dictionary Item.

What actually makes me think if I shall open another issue and ask whether there are plans for some plugin mechanism )

@rcoh
Copy link
Owner

rcoh commented Jul 7, 2019 via email

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