Showing the number on the dashboard from the latest graylog message

Hello guys and girls,

I wish to read some important business metrics from various apps and push the logs to graylog periodically. Basically, i would read a metric (NPS) from service called ‘AskNicely’ and get a simple number like ‘24’, and then push message to graylog with that value in it.

I wish to show the number ‘24’ (the number from the latest graylog message) in one of my dashboards.

Is this functionality supported, or is there a plugin that can help me with that.

Thank you very much.

No, that’s unfortunately not supported out of the box.

I was looking at documentation to write such plugin, but i can’t seem to find the correct documentation page for writing custom dashbobard widget.

I would be grateful if your could direct me to the right resource. Thanks.

Unfortunately there’s no comprehensive plugin development documentation but you can take a look at the Map Widget plugin which provides a custom widget via plugin:

Thanks! That’s a great way to start.

We do something similar without a custom plugin.
On a daily basis (cronjob) a system gathers all key company metrics and posts a message to Graylog.
Each key metric is a field in the message.

To display this on a dashboard, choose the stat | maximum value, and make sure the time range does not exceed the message reporting frequency (in our case 1d time range works perfect)

Hope this helps.

That’s interesting workaround, and i had the same idea, but for some reason graylog does not calculate the statistic for that field properly

I’ve uploaded and image illustrating the issue. Did i do something wrong?

Thanks for suggestion. If i make this work, this will definitely be the most simple workaround for what i want to accomplish.

I suspect your nps_score is of string type. You can set up a custom field mapping to force it to be a number.

jtkarvo is right, the field type needs to be changed.
What system are you using to log the data? it could be set when logging, or can be changed in graylog using custom field mapping.

Yup that was the case. First log i sent was in decimal format (50.2) and graylog (or elasic search) started treating that field as string.

I was using gelf-php a php library for logging to graylog from php apps.

Thanks everyone for help, 123dev comment helped me save time to get the result i wanted.

<3 graylog community

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.