Skip to content

Commit 5f0f92a

Browse files
microsoft_dnsserver: Enrich dns.question.* ECS fields for both datastream
1 parent f6b7e12 commit 5f0f92a

File tree

6 files changed

+68
-16
lines changed

6 files changed

+68
-16
lines changed

packages/microsoft_dnsserver/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "1.4.0"
3+
changes:
4+
- description: Enrich dns.question.* fields.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/14336
27
- version: "1.3.0"
38
changes:
49
- description: Remove duplicated installation instructions from the documentation.

packages/microsoft_dnsserver/data_stream/analytical/_dev/test/pipeline/test-events.json-expected.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"dns": {
2525
"id": "7",
2626
"question": {
27-
"name": "google.es.",
27+
"name": "google.es",
28+
"registered_domain": "google.es",
29+
"top_level_domain": "es",
2830
"type": "AAAA"
2931
},
3032
"response_code": "NoError"
@@ -120,7 +122,9 @@
120122
],
121123
"id": "14383",
122124
"question": {
123-
"name": "google.es.",
125+
"name": "google.es",
126+
"registered_domain": "google.es",
127+
"top_level_domain": "es",
124128
"type": "AAAA"
125129
}
126130
},
@@ -261,7 +265,9 @@
261265
],
262266
"id": "6",
263267
"question": {
264-
"name": "google.es.",
268+
"name": "google.es",
269+
"registered_domain": "google.es",
270+
"top_level_domain": "es",
265271
"type": "A"
266272
}
267273
},
@@ -390,7 +396,9 @@
390396
"dns": {
391397
"id": "23472",
392398
"question": {
393-
"name": "example.com.",
399+
"name": "example.com",
400+
"registered_domain": "example.com",
401+
"top_level_domain": "com",
394402
"type": "A"
395403
}
396404
},

packages/microsoft_dnsserver/data_stream/analytical/elasticsearch/ingest_pipeline/default.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,27 @@ processors:
312312
copy_from: microsoft_dnsserver.analytical.xid
313313
ignore_empty_value: true
314314
tag: set_dns_id
315-
- set:
316-
field: dns.question.name
317-
copy_from: microsoft_dnsserver.analytical.question_name
318-
ignore_empty_value: true
319-
tag: set_dns_question_name
315+
- gsub:
316+
field: microsoft_dnsserver.analytical.question_name
317+
target_field: _temp.question_name
318+
tag: gsub_trim_trailing_dot
319+
pattern: \.$
320+
replacement: ""
321+
ignore_missing: true
322+
- registered_domain:
323+
field: _temp.question_name
324+
tag: registered_domain_question_name
325+
target_field: dns.question
326+
ignore_missing: true
327+
on_failure:
328+
- append:
329+
field: error.message
330+
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
331+
- rename:
332+
field: dns.question.domain
333+
tag: rename_dns_question_domain
334+
target_field: dns.question.name
335+
ignore_missing: true
320336
- set:
321337
field: dns.question.type
322338
copy_from: microsoft_dnsserver.analytical.question_type
@@ -364,6 +380,7 @@ processors:
364380
tag: append_dns_header_flag_TC
365381
- remove:
366382
field:
383+
- _temp
367384
- microsoft_dnsserver.analytical.AA
368385
- microsoft_dnsserver.analytical.AD
369386
- microsoft_dnsserver.analytical.RD

packages/microsoft_dnsserver/data_stream/audit/_dev/test/pipeline/test-events.json-expected.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@
138138
},
139139
"dns": {
140140
"question": {
141-
"name": "B.ROOT-SERVERS.NET.",
141+
"name": "B.ROOT-SERVERS.NET",
142+
"registered_domain": "root-servers.net",
143+
"top_level_domain": "net",
142144
"type": "AAAA"
143145
}
144146
},

packages/microsoft_dnsserver/data_stream/audit/elasticsearch/ingest_pipeline/default.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,27 @@ processors:
282282
copy_from: microsoft_dnsserver.audit.ttl
283283
ignore_empty_value: true
284284
tag: set_dns_answers_ttl
285-
- set:
286-
field: dns.question.name
287-
copy_from: microsoft_dnsserver.audit.question_name
288-
ignore_empty_value: true
289-
tag: set_dns_question_name
285+
- gsub:
286+
field: microsoft_dnsserver.audit.question_name
287+
target_field: _temp.question_name
288+
tag: gsub_trim_trailing_dot
289+
pattern: \.$
290+
replacement: ""
291+
ignore_missing: true
292+
- registered_domain:
293+
field: _temp.question_name
294+
tag: registered_domain_question_name
295+
target_field: dns.question
296+
ignore_missing: true
297+
on_failure:
298+
- append:
299+
field: error.message
300+
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
301+
- rename:
302+
field: dns.question.domain
303+
tag: rename_dns_question_domain
304+
target_field: dns.question.name
305+
ignore_missing: true
290306
- set:
291307
field: dns.question.type
292308
copy_from: microsoft_dnsserver.audit.question_type
@@ -308,6 +324,10 @@ processors:
308324
copy_from: microsoft_dnsserver.audit.bytes_sent
309325
ignore_empty_value: true
310326
tag: set_network_bytes
327+
- remove:
328+
field: _temp
329+
ignore_missing: true
330+
tag: remove_temp_question_name
311331

312332
# Source IP
313333
- convert:

packages/microsoft_dnsserver/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: microsoft_dnsserver
33
title: Microsoft DNS Server
44
description: Collect logs from Microsoft DNS Server with Elastic Agent.
55
type: integration
6-
version: "1.3.0"
6+
version: "1.4.0"
77
conditions:
88
kibana:
99
version: ^8.13.0 || ^9.0.0

0 commit comments

Comments
 (0)