pylon

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: MIT

README

pylon

The Pihole query log extraction, conversion and export tool

Pylon is a command line tool that allows dumping Pihole query log from the pihole-FTL.db file in one of the following formats:

  • Line-delimited JSON for further processing with tools such as jq
  • InfluxDB Line Protocol format for import by Telegraf

Pylon also has ability to export and send Pihole query logs to external systems. At this moment, it only supports InfluxDB v2.

Examples

Dump all Pihole queries made in Feb 2023 in JSON format in stdout
$ pylon dump \
      --start '2023-02-01T00:00:00Z' \
      --end '2023-02-28T23:59:59Z' \
      --format json \
      /etc/pihole/pihole-FTL.db

# Example output
{
  "timestamp": "2023-02-03T09:46:58.986-08:00",
  "type": "A",
  "decision": "ALLOWED",
  "reason": "CACHED",
  "domain": "example.com",
  "client": "127.0.0.1",
  "forward": "NONE",
  "reply_type": "IP",
  "reply_time": 100000,
  "dnssec": "UNKNOWN"
}
Send all Pihole queries made in Feb 2023 to InfluxDB2
$ export INFLUXDB2_URL='https://influxdb.example.com'
$ export INFLUXDB2_TOKEN='super-secret-token'

$ pylon export \
      --start '2023-02-01T00:00:00Z' \
      --end '2023-02-28T23:59:59Z' \
      --dest influxdb2 \
      --influxdb2-org 'ExampleOrg' \
      --incluxdb2-bucket 'ExampleBucket' \
      /etc/pihole/pihole-FTL.db

License

MIT

Directories

Path Synopsis
cmd
pihole
ftl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL