Skip to content

Instantly share code, notes, and snippets.

@Findarato
Last active July 26, 2017 22:37
Show Gist options
  • Save Findarato/65cb8cf035b3ad84991bb9c1712b9a9d to your computer and use it in GitHub Desktop.
Save Findarato/65cb8cf035b3ad84991bb9c1712b9a9d to your computer and use it in GitHub Desktop.
Telegraf parser for folding at home progress
# Stream and parse log file(s).
[[inputs.logparser]]
files = ["/var/lib/fahclient/log.txt"]
from_beginning = true
[inputs.logparser.grok]
patterns = ["%{FAH_WORKUNITS}","%{FAH_POINTS}"]
measurement = "fah"
custom_patterns = '''
FAH_WORKUNITS %{DATA:timestamp:ts-"2006-01-02:15:04:05"}\:WU%{NUMBER:workunit:tag}\:FS%{NUMBER:slot:string}\:%{DATA:core:string}\:Completed %{NUMBER:progress:int} out of %{NUMBER:total:int} steps
FAH_POINTS %{DATA:timestamp:ts-"2006-01-02:15:04:05"}\:WU%{NUMBER:workunit:tag}\:FS%{NUMBER:slot:string}\:Final credit estimate, %{NUMBER:points:float} points
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment