You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello - I'm parsing a log that has a HEX representation of an ASCII string somewhere in the line. For instance: thing=313241414242, which decoded results in thing=12AABB. I'd like to parse this string and report the decoded ASCII string back to prometheus as a label.
I'm trying to use the DecodeString function from the hex package. However, when I try to start grok_exporter, it complains that:
Failed to load ...: invalid configuration: failed to read metric label thing_counter: error parsing thing template: template: thing:1: function "hex" not defined: don't forget to put a . (dot) in front of grok fields, otherwise it will be interpreted as a function.
I'm not skilled in go, nor its templating engine, but I learned I have to use FuncMap to pass the names of the functions that I need to the template. Any suggestions on how I can use FuncMap from within grok_exporter to be able to access hex.DecodeString?
Thanks
The text was updated successfully, but these errors were encountered:
Hello - I'm parsing a log that has a HEX representation of an ASCII string somewhere in the line. For instance:
thing=313241414242
, which decoded results inthing=12AABB
. I'd like to parse this string and report the decoded ASCII string back to prometheus as a label.The grok configuration looks something like this:
I'm trying to use the DecodeString function from the hex package. However, when I try to start grok_exporter, it complains that:
I'm not skilled in go, nor its templating engine, but I learned I have to use FuncMap to pass the names of the functions that I need to the template. Any suggestions on how I can use FuncMap from within grok_exporter to be able to access hex.DecodeString?
Thanks
The text was updated successfully, but these errors were encountered: