Open shinebayar-g opened 5 years ago
Because you use none
parser.
It creates {"message":"foo: 1"}
so prometheus filter ignores it.
I see, now I use json parser and also noticed value must be number. Actually prometheus metrics shows exact value of the key. I thought counter would go up by 1 whenever I guess this working as intended. foo
appears in log again.
My log looks like this which is why I use none parser at the moment.
INFO - 2019-07-04 11:27:52 --> Something here
ERROR - 2019-07-04 11:26:43 --> Error message here
I wanted to count how many INFO
or ERROR
s I'm getting in logs using this plugin. Is it possible to achieve? If so how should I structure my log format?
If not please let me know, thank you.
How about counting these value by prometheus side? see https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors
like
fluentd_***_***{foo=~"ERROR - "}
Hi, this is my config.
To test prometheus metrics I've created
test.log
file in /var/log/app/ folder with following content.When I curl
localhost:24231/metrics
endpoint I get:As you see
message_foo_counter
metric is not working. What am I could be missing? :sos: