Greetings:
I am new to Loki and am trying to ingest some web servers logs that are formatted in W3C Extended Log File format. My particular instance is tab-delimited. Here is an example of a log line:
192.168.0.20 2022-01-26 16:19:36 GET /wls-exporter/metrics 200 0.003
Unfortunately, I am unable to add keys to this data, so Loki is unable to parse out the fields automatically with logfmt. I read about the Pattern parser in the documentation, but it doesn’t seem to work to get individual values out of my entries. Here’s the patterns I’ve tried so far:
"<client-ip> <date> <time> <method> <uri> <status> <resp-time>"
"<client-ip> <_> <date> <_> <time> <_> <method> <_> <uri> <_> <status> <_> <resp-time>"
"<_> <client-ip> <date> <time> <method> <uri> <status> <resp-time>"
The first entry was the closest, but it’s putting all values into the “client_ip” field which isn’t what I want:
client_ip 192.168.0.20 2022-01-26 16:19:36 GET /wls-exporter/metrics 200 0.003
Can someone point me toward a way of getting the pattern parser to split the fields up, or explain what I’m doing wrong?
Thanks for the help!