nickoppen / piholeLogAnalyser-

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grok++ library

A C++ implementation of Roman Marusyk's Grok.Net. All credit for the design goes to him.

To Compile

  • include -pthread as a dependency in linker options

To Run

PiholeLogAnalyser++

An interpreter/loader for pihole log files. Output is stored in a MariaDB database.

Written in C++ and developed on the pi.

Prerequisites:

To Compile

  • compile to gnu++17 standard
  • in linker directory options include -lmariadb once libmariadb.so (linked to libmariadb.so.3) in /usr/lib/mariadb
  • include stdc++fs as a linker dependency

To Run

  • Set up the database as per the database schema

  • Root priviledges are needed to read /var/log/pihole/pihole.log.1

  • Copy your grok custom pattern file to an accessible location (default: ./grokCustom.txt) Note: if you have scheduled execution using cron then . (current directory) is the users home directory.

  • Commandline options are:

          -d Directory : directory to be scanned (default: /var/log/pihole)
          -r : scan recursively (recurse == false)
          -f 'Filename pattern' : load a specific log file with wildcards ? and \* (default: pihole.log.1) Note: '' to ensure that the wildcards are not expanded by the shell
          -p : Pretend to add to the database (default: false)
          -t milliseconds : max exec time for regex match function (default == 0 or no time limit)
          -g File name : specify the location of the grok custom pattern file (default: ./grokCustom.txt)
          -e Full path to the load error file (default: ./loadError.txt)
          -user username : log in to the database with the given username
          -pwd pwd : log into the database with the given password
          -ip IP Address : look for the database at the given IP address or url
          -port portNum : connect to the database on the given port
          -db dbName : connect to the database with the given name
          -check : checks the database, directory and file spec for log files the grok custom pattern file and then exits (output in load error file)
          -h or -help : print this text
    

About

License:The Unlicense


Languages

Language:C++ 96.3%Language:CSS 3.7%