From ecb9ea88ce4c2f8a705c0d9b52589a74723d9653 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Fri, 1 Sep 2023 10:40:40 -0400 Subject: [PATCH 1/3] fix(syslog source, docs): Fix docs for `host` field for syslog source It is incorrectly documented as using `gethostname` on the host receiving the data, but actually extracts the host from the log message itself. Closes: #18371 Signed-off-by: Jesse Szwedko --- website/cue/reference/components/sources/syslog.cue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/cue/reference/components/sources/syslog.cue b/website/cue/reference/components/sources/syslog.cue index 4a8504dd6f3ff..849f6e393ecf7 100644 --- a/website/cue/reference/components/sources/syslog.cue +++ b/website/cue/reference/components/sources/syslog.cue @@ -59,7 +59,13 @@ components: sources: syslog: { examples: ["app-name"] } } - host: fields._local_host + host: { + description: "The hostname extracted from the Syslog line." + required: true + type: string: { + examples: ["my.host.com"] + } + } hostname: { description: "The hostname extracted from the Syslog line. (`host` is also this value if it exists in the log.)" required: true From 3f25b79781c92d11cf9b9b3ac541bc57492c3537 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Fri, 1 Sep 2023 16:34:56 -0400 Subject: [PATCH 2/3] Add note about fallback to the peer IP Signed-off-by: Jesse Szwedko --- website/cue/reference/components/sources/syslog.cue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/cue/reference/components/sources/syslog.cue b/website/cue/reference/components/sources/syslog.cue index 849f6e393ecf7..dd99d6578052c 100644 --- a/website/cue/reference/components/sources/syslog.cue +++ b/website/cue/reference/components/sources/syslog.cue @@ -60,7 +60,7 @@ components: sources: syslog: { } } host: { - description: "The hostname extracted from the Syslog line." + description: "The hostname extracted from the Syslog message. If no hostname can be extracted from the Syslog message, the IP address of the peer is used instead." required: true type: string: { examples: ["my.host.com"] From 327add54bf5d89f1a77d4b47828edf258a55ce70 Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Wed, 6 Sep 2023 10:07:52 -0700 Subject: [PATCH 3/3] Feedback Signed-off-by: Jesse Szwedko --- website/cue/reference/components/sources/syslog.cue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/cue/reference/components/sources/syslog.cue b/website/cue/reference/components/sources/syslog.cue index dd99d6578052c..9efb9c09f0902 100644 --- a/website/cue/reference/components/sources/syslog.cue +++ b/website/cue/reference/components/sources/syslog.cue @@ -60,14 +60,14 @@ components: sources: syslog: { } } host: { - description: "The hostname extracted from the Syslog message. If no hostname can be extracted from the Syslog message, the IP address of the peer is used instead." + description: "Same as `hostname` if that field is set, or the IP address of the peer otherwise." required: true type: string: { - examples: ["my.host.com"] + examples: ["my.host.com", "127.0.0.1"] } } hostname: { - description: "The hostname extracted from the Syslog line. (`host` is also this value if it exists in the log.)" + description: "The `hostname` field extracted from the Syslog line. If a `hostname` field is found, `host` is also set to this value." required: true type: string: { examples: ["my.host.com"]