How to add new values like IP Address as a groupable part of the log structure rather than just the general "message"?

I have a log in my Go application:

log.Printf("Pixel updated: index=%d, color=%s, ip=%s", update.Data.Index, update.Data.Color, ip)

I want to go into Grafana > Explore then create a “Metric” query where I group by IP address.

The problem is that none of the values I pass in show up in the Group By dropdown. This is also a problem if I pass in the fields in as an object too.

How can I log values with fly.io such that they show up in the “Log Search” Grafana logs explore?

1 Like

Added logs

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