fxnn / gowatch

Configurable logfile analysis for your server.
MIT License
8 stars 2 forks source link

Add tag when predicate matches #3

Open fxnn opened 9 years ago

fxnn commented 9 years ago

While currently, one can only add tags to each line of a logfile, it should be possible to add tags only to lines matching a given predicate.

Though this is currently possible by parsing the same file multiple times with different predicates, that's not the way it's supposed to work.

Possible syntax would be

logfiles:
- filename: /path/to/file.log
  tags:
  - tag_for_each_line
  - tag_for_few_lines: {
      Message: { contains: some text }
    }

Alternatively, we could provide this feature only by using an extended mapping section, in addition to the existing logfiles and summary sections.

(Note, that this already uses the new predicate syntax from #4)