-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Question][logparser] Best approach for logparser generating two metrics #7287
Comments
The general idea is to parse each value in the log as a field, not as the measurement/tags. It will be helpful to think in terms of the Telegraf/InfluxDB model even though you are outputting to prometheus, each log line will create a single Telegraf metric (We usually report durations and timestamps in nanoseconds):
In the prometheus output, use
|
Thanks for your answer @danielnelson! I was indeed more thinking in terms of Prometheus than InfluxDB, without considering that it's only when it comes to the output that everything gets transformed into Prometheus. I've been reading a little about InfluxDB now to get familiar about the terms. I have followed the example in logparser but can't still get the timestamp metric.
With my input being
And my output config
With these settings, the metric generated is only
Also from your comment it would be better to parse EDIT: After some initial troubleshooting:
|
Realized what I actually needed is that the metric is issued with its related I raised #7289 to fix the behavior (if this is the intended behavior I will drop the PR). Closing this question |
Hi,
I would like some guidance on the best approach for my scenario.
logparser
for parsing multiple log files on a folder. All of them look for a pattern which contains the timestamp and a numeric value (duration
)duration
value, but also thetimestamp
, since I will be using each of them in dashboards.By setting a pattern, I can define one of them as the measurement and the other as a label, but I don´t seem to be able to issue two different metrics.
Is there a way two accomplish this with the
logparser
input plugin? Or should I use a processor plugin instead? (maybe theclone
would do?)I guess I could just add two
logparser
blocks over the same log files, each of them issuing a metric, but I guess it´s not the best way to go?Thanks in advance!
The text was updated successfully, but these errors were encountered: