-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more docs for the atags transformer (#656)
* add more docs * add tests * update docs * add text directive
- Loading branch information
Showing
11 changed files
with
205 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,63 @@ | ||
# Transformer: ATags | ||
|
||
Use this transformer to add additional flag in your DNS logs. | ||
Use this transformer to add additional tags in your DNS logs. | ||
|
||
This transformation can be valuable in the `pipeline` mode, where it's possible to match specific traffic. | ||
In such cases, you can include a tag for identification." | ||
|
||
A list of string is expected in the `tag` field. | ||
|
||
Configuration example: | ||
|
||
```yaml | ||
- name: filter | ||
transforms: | ||
atags: | ||
tags: [ "TXT:google", "MX:apple" ] | ||
``` | ||
When the feature is enabled, the following json field are populated in your DNS message: | ||
Flat JSON: | ||
```json | ||
{ | ||
"atags.tags.0": "TXT:google", | ||
"atags.tags.1": "MX:apple" | ||
} | ||
|
||
Default JSON structure: | ||
|
||
```json | ||
{ | ||
"atags": { | ||
"tags": [ "test0", "test1" ] | ||
} | ||
} | ||
``` | ||
|
||
Complete example with the `dnsmessage` collector | ||
|
||
```yaml | ||
pipelines: | ||
- name: filter | ||
dnsmessage: | ||
matching: | ||
matching: | ||
include: | ||
dns.qname: "^.*\\.google\\.com$" | ||
dns.qname: "^.*\\.google\\.com$" | ||
transforms: | ||
atags: | ||
atags: | ||
tags: [ "google"] | ||
routing-policy: | ||
dropped: [ outputfile ] | ||
default: [ central ] | ||
``` | ||
|
||
Custom text format: | ||
|
||
If you logs your DNS traffic in basic text format, you can use the specific directives: | ||
|
||
- `atags[:INDEX]`: get all tags separated by comma, or the tag according to the provided INDEX | ||
|
||
```yaml | ||
- name: console | ||
stdout: | ||
mode: text | ||
text-format: "timestamp-rfc3339ns identity qr qname qtype atags:0" | ||
``` |