Regular Expressions 101

Community Patterns

named query log parse

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?P<datetime>.*?) queries: info: client @[0-9a-fx]* (?P<source_ip>[\w.:]*)#\d+ \(.*\): view (?P<view_name>\w+): query: (?P<domain>[\w.-]+) IN (?P<type>\w+) .*? \((?P<name_server>[\w.:]+)\)
/
gm

Description

It's a simple regexp for dns-query.log

Submitted by anonymous - a year ago