Product Updates   Observability   Logging  

New Custom Regex Log Ingestion

By Rachel Fong  |   Last modified on January 11, 2019

Unstructured text logs are so last decade, but sometimes you have to deal with them because they aren’t actually all that prehistoric in human years…or you just need us to ingest formats we don’t actually support yet.

We recently added custom regex support to honeytail, our agent for consuming existing log files, so you can now write your own custom formats for logs you want to analyze in Honeycomb.

Matching log lines will be parsed as events, with named regex capture groups corresponding to columns.

As an example, let’s ingest a Rails log file, one of a class of many objects that I would much rather never look through manually.

Rails log sample

Just construct a regex that pulls out the fields you want, and pass it to honeytail to get your awful looking log dumps parsed and ready to investigate in Honeycomb.

honeytail --writekey=MYWRITEKEY --dataset=MYDATASET `
    --parser=”regex” --regex.timefield="time" ``
    --regex.line-regex=”(?P<time>S+) (?P<source>.*): at=(?P<log_level>.*) method=(?P<http_method>.*) path="(?P<path>.*) ..."`

Rails logs in Honeycomb

Fascinating! Suspicious! Weird, even! Mostly, I’m excited that I can now click to sort all my requests by latency and filter to instantly see time-series graphs, instead of artisanally constructing an elaborate series of bash pipes.

Multiple line formats

We support passing multiple patterns, so you can parse logs with mixed output formats into the same dataset by adding additional —regex.line_regex flags to your honeytail call. (Order matters when we regex match your log lines, so put your most specific regexes first.)

Rails log sample with mixed output formats

honeytail --writekey=MYWRITEKEY --dataset=MYDATASET ``
    --parser=”regex” --regex.timefield="time" `
    --regex.line-regex=”(?P<time>S+) (?P<source>.*): at=(?P<log_level>.*) method=(?P<http_method>.*) path="(?P<path>.*) ..." `
    --regex.line-regex=”(?P<time>S+) (?P<source>.*): (?P<msg>.*)”`

FAQ

  • Nested capture groups are supported! (?P<outer>[^ ]* (?P<inner1>[^ ]*) (?P<inner2>[^ ]*))
    (Field names are WYSIWYG, e.g. inner1 instead of outer.inner1.)
  • Multiline regexes are not supported
  • Uses Google’s RE2 syntax

Check out the honeytail regex parser docs to get set up and try out some quickstart examples, and please contact us if you have questions. Happy string munging!

 

Related Posts

Observability   Monitoring  

APM From a Developer’s Perspective

In twenty years of software development, I did not have the privilege of being on call, of tending to my software in production. I’ve never...

Observability   Customer Stories  

Flight to Success: Birdie's DevOps Evolution Fueled by Observability Insights

Birdie’s platform is a complex software system that covers a lot of ground—from care management and rostering to HR and finance. To ensure the platform...

Product Updates   Instrumentation  

Safer Client-Side Instrumentation with Honeycomb's Ingest-Only API Keys

We're delighted to introduce our new Ingest API Keys, a significant step toward enabling all Honeycomb customers to manage their observability complexity simply, efficiently, and...