
global:
  trace:
    verbose: true

pipelines:
  - name: prom
    prometheus:
      listen-ip: 0.0.0.0
      listen-port: 8081
      basic-auth-enable: false
      prometheus-prefix: "dnscollector"
      top-n: 200
      prometheus-labels: [ "stream_id" ]

  - name: dnsdist
    dnstap:
      listen-ip: 0.0.0.0
      listen-port: 6000
    transforms:
      normalize:
        qname-lowercase: true
    routing-policy:
      forward: [ txt-queries, prom ]

  - name: txt-queries
    dnsmessage:
      matching:
        include:
          dnstap.operation: "CLIENT_RESPONSE"
          dns.qtype: "TXT"
    transforms:
      atags:
        add-tags: [ "TAG:TXT-QUERIES" ]
    routing-policy:
      forward: [ apple-txt, all-txt ]

  - name: all-txt
    dnsmessage:
      matching:
        include:
          dnstap.operation: "CLIENT_RESPONSE"
    routing-policy:
      forward: [ outputfile-justtxt ]

  - name: apple-txt
    dnsmessage:
      matching:
        include:
          dns.qtype: "TXT"
          dns.qname: "^*.apple.com$"
    transforms:
      atags:
        add-tags: [ "TXT:apple" ]
    routing-policy:
      forward: [ outputfile-apple ]

  - name: outputfile-justtxt
    logfile:
      file-path:  "/tmp/dnstap-txt.log"
      max-size: 100
      max-files: 10
      mode: json
    transforms:
      user-privacy:
        anonymize-ip: true
        anonymize-v4bits: "/0"
        anonymize-v6bits: "::/128"

  - name: outputfile-apple
    logfile:
      file-path:  "/tmp/dnstap.log"
      max-size: 100
      max-files: 10
      mode: json
    transforms:
      user-privacy:
        anonymize-ip: true
        anonymize-v4bits: "/0"
        anonymize-v6bits: "::/0"
