Skip to content

Instantly share code, notes, and snippets.

@DRuggeri
Created April 19, 2025 14:27
Show Gist options
  • Select an option

  • Save DRuggeri/adf7075721af1516d2ed933815597482 to your computer and use it in GitHub Desktop.

Select an option

Save DRuggeri/adf7075721af1516d2ed933815597482 to your computer and use it in GitHub Desktop.
Open Telemetry collector processing of Apache combined vhost logs
filelog/apacheaccess:
include:
- /var/log/apache2/other_vhosts_access.log
operators:
- type: regex_parser
# boss.home.bitnebula.com:80 192.168.122.10 - - [19/Apr/2025:08:16:45 -0500] "GET /talos-netboot-ipxe/16-09-01-1a-f4-30.ipxe HTTP/1.1" 404 488 "-" "iPXE/1.0.0+git-20190125.36a4c85-5.1"
regex: |-
^(?P<vhost>[^:]+):(?P<port>\d+) (?P<remote>\S+) (?P<logname>\S+) (?P<user>\S+) \[(?P<ts>[^\]]+)\] "(?P<method>\S+) +(?P<uri>[^ ]+) (?P<httpver>[^"]+)" (?P<code>\d+) (?P<bytes>\d+) "(?P<referrer>[^"]+)" "(?P<useragent>[^"]+)"
timestamp:
parse_from: attributes.ts
layout_type: gotime
layout: '02/Jan/2006:15:04:05 -0700'
- type: remove
field: attributes.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment