Skip to content

Instantly share code, notes, and snippets.

@johntdyer
Created April 29, 2023 01:11
Show Gist options
  • Save johntdyer/4a13d2ea4c5cae589e14d421edccb80b to your computer and use it in GitHub Desktop.
Save johntdyer/4a13d2ea4c5cae589e14d421edccb80b to your computer and use it in GitHub Desktop.
Promtail scrape config for PlexMedia Server
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://192.168.100.8:3100/loki/api/v1/push
scrape_configs:
- job_name: plexmediaserver
static_configs:
- labels:
__path__: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log
job: plexmediaserver
server: "plex"
pipeline_stages:
- regex:
expression: "^(?s)(?P<time>\\w+ \\d+, \\d+ \\d+:\\d+:\\d+\\.\\d+?) \\[(?P<epoch>[^\\]]+)\\] (?P<level>[a-zA-Z]+) - (?P<content>.*)$"
- labels:
level:
content:
- timestamp:
source: time
format: "Jan 02, 2006 15:04:05.000"
location: "Etc/UTC"
- output:
source: content
- job_name: journal
journal:
max_age: 12h
labels:
job: systemd-journal
relabel_configs:
- source_labels: ["__journal__systemd_unit"]
target_label: "unit"
- source_labels: ["__journal__hostname"]
target_label: "hostname"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment