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

Parsing Node out log #137

Open
osgafarov opened this issue Jul 30, 2018 · 6 comments
Open

Parsing Node out log #137

osgafarov opened this issue Jul 30, 2018 · 6 comments

Comments

@osgafarov
Copy link

Hi guys,

Is there a support in logagent for parsing logs of the following format:

�[0mGET /styles.db0a1697fcca0b6b5960.bundle.css �[36m304 �[0m0.515 ms - -�[0m
[0mGET /assets/loader.css �[36m304 �[0m0.569 ms - -�[0m

Thanks!

@otisg
Copy link
Member

otisg commented Jul 30, 2018

You can always write a custom parsing rule (in patterns.yml). See https://sematext.com/docs/logagent/parser/

@osgafarov
Copy link
Author

Ok, so there is none. Thanks! I will implement it.

@otisg
Copy link
Member

otisg commented Jul 30, 2018

What sort of application emits such logs? Is this from a custom application you wrote or something that many other people use? If it's the latter, it would be great if you could contribute your pattern through a PR.

@osgafarov
Copy link
Author

These logs are from an Angular app. Will post a PR once I implement it.

@otisg
Copy link
Member

otisg commented Aug 3, 2018

Great, thanks!

@megastef
Copy link
Contributor

I think what you need to do is removing the ANSI escape sequences for terminal colour codes.
The docker plugin has this functionality too.

See:
https://github.com/sematext/logagent-js/blob/master/lib/plugins/input/docker/docker.js#L7
https://github.com/sematext/logagent-js/blob/master/lib/plugins/input/docker/docker.js#L110

We could first implement an input-filter to make the removal of ANSI escape sequences a general feature.
The rest would just be a new pattern definition in patterns.yml.

You can find here an example of an input-filter: https://github.com/sematext/logagent-js/blob/master/lib/plugins/input-filter/grep.js

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

3 participants