Skip to content

Commit 69d5d30

Browse files
pls-no-hackRory Befd6andrewkroh
authored
feat(cloudflare_logpush): add SourceInternalIP to related.ip field(#15088)
Update gateway_http and gateway_network data streams to include the Cloudflare SourceInternalIP field value in the related.ip array for better IP correlation and analysis. The internal source IP provides additional context about the originating device within the network. Co-authored-by: Rory B <[email protected]> Co-authored-by: Dan Kortschak <[email protected]> Co-authored-by: Andrew Kroh <[email protected]>
1 parent c59a781 commit 69d5d30

File tree

7 files changed

+29
-8
lines changed

7 files changed

+29
-8
lines changed

packages/cloudflare_logpush/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.41.0"
3+
changes:
4+
- description: Add Cloudflare `SourceInternalIP` field values to `related.ip` for the gateway_http and gateway_network data streams.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/15088
27
- version: "1.40.0"
38
changes:
49
- description: Added support for Azure Blob Storage input for all data streams.

packages/cloudflare_logpush/data_stream/gateway_http/_dev/test/pipeline/test-pipeline-gateway-http.log-expected.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@
129129
],
130130
"ip": [
131131
"67.43.156.2",
132-
"89.160.20.129"
132+
"89.160.20.129",
133+
"192.168.1.123"
133134
],
134135
"user": [
135136
"166befbb-00e3-5e20-bd6e-27245723949f",
@@ -298,7 +299,8 @@
298299
],
299300
"ip": [
300301
"67.43.156.2",
301-
"89.160.20.129"
302+
"89.160.20.129",
303+
"192.168.1.123"
302304
],
303305
"user": [
304306
"166befbb-00e3-5e20-bd6e-27245723949f",
@@ -467,7 +469,8 @@
467469
],
468470
"ip": [
469471
"67.43.156.2",
470-
"89.160.20.129"
472+
"89.160.20.129",
473+
"192.168.1.123"
471474
],
472475
"user": [
473476
"166befbb-00e3-5e20-bd6e-27245723949f",

packages/cloudflare_logpush/data_stream/gateway_http/elasticsearch/ingest_pipeline/default.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ processors:
392392
value: "{{{destination.ip}}}"
393393
if: ctx.destination?.ip != null
394394
allow_duplicates: false
395+
- append:
396+
field: related.ip
397+
value: "{{{cloudflare_logpush.gateway_http.source.internal_ip}}}"
398+
if: ctx.cloudflare_logpush?.gateway_http?.source?.internal_ip != null && ctx.cloudflare_logpush.gateway_http.source.internal_ip != ''
399+
allow_duplicates: false
395400
- append:
396401
field: related.hosts
397402
value: "{{{host.id}}}"

packages/cloudflare_logpush/data_stream/gateway_network/_dev/test/pipeline/test-pipeline-gateway-network.log-expected.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
"ip": [
9292
"67.43.156.2",
9393
"89.160.20.129",
94-
"175.16.199.4"
94+
"175.16.199.4",
95+
"192.168.1.3"
9596
],
9697
"user": [
9798
"166befbb-00e3-5e20-bd6e-27245723949f",
@@ -219,7 +220,8 @@
219220
"ip": [
220221
"67.43.156.2",
221222
"89.160.20.129",
222-
"175.16.199.4"
223+
"175.16.199.4",
224+
"192.168.1.3"
223225
],
224226
"user": [
225227
"166befbb-00e3-5e20-bd6e-27245723949f",
@@ -347,7 +349,8 @@
347349
"ip": [
348350
"67.43.156.2",
349351
"89.160.20.129",
350-
"175.16.199.4"
352+
"175.16.199.4",
353+
"192.168.1.3"
351354
],
352355
"user": [
353356
"166befbb-00e3-5e20-bd6e-27245723949f",

packages/cloudflare_logpush/data_stream/gateway_network/elasticsearch/ingest_pipeline/default.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ processors:
292292
value: "{{{cloudflare_logpush.gateway_network.override.ip}}}"
293293
if: ctx.cloudflare_logpush?.gateway_network?.override?.ip != null
294294
allow_duplicates: false
295+
- append:
296+
field: related.ip
297+
value: "{{{cloudflare_logpush.gateway_network.source.internal_ip}}}"
298+
if: ctx.cloudflare_logpush?.gateway_network?.source?.internal_ip != null && ctx.cloudflare_logpush.gateway_network.source.internal_ip != ''
299+
allow_duplicates: false
295300
- append:
296301
field: related.hosts
297302
value: "{{{destination.domain}}}"

packages/cloudflare_logpush/data_stream/workers_trace/_dev/test/system/test-http-endpoint-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ data_stream:
99
listen_port: 9560
1010
preserve_original_event: true
1111
preserve_duplicate_custom_fields: true
12-
enable_request_tracer: true
12+
enable_request_tracer: true

packages/cloudflare_logpush/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.0.2"
22
name: cloudflare_logpush
33
title: Cloudflare Logpush
4-
version: "1.40.0"
4+
version: "1.41.0"
55
description: Collect and parse logs from Cloudflare API with Elastic Agent.
66
type: integration
77
categories:

0 commit comments

Comments
 (0)