Skip to content

Commit 4dd1a6e

Browse files
Merge pull request #71 from axoflow/check-hostname-update
Documents the check-hostname source-level option
2 parents a166549 + 61393d5 commit 4dd1a6e

File tree

13 files changed

+46
-2
lines changed

13 files changed

+46
-2
lines changed

content/chapter-global-options/reference-options/_index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,20 @@ For example, consider a client-relay-server scenario with the following hostname
121121
| Accepted values: | `yes`, `no` |
122122
| Default: | `no` |
123123

124-
*Description:* Enable or disable checking whether the hostname contains valid characters.
124+
*Description:* When receiving messages, {{< product >}} can check whether the hostname contains valid characters.
125125

126+
Valid characters are:
126127

128+
- alphanumeric characters (A-Z, a-z, 0-9)
129+
- the dash (`-`) and underscore (`_`) characters
130+
- the dot (`.`) and the colon (`:`) characters
131+
- the `@` and slash (`/`)
132+
133+
If the hostname contains invalid characters, {{< product >}} sets the `syslog.invalid_hostname` tag for the message, and doesn't parse the `${HOST}` field from the message.
134+
135+
The `check-hostname()` global option applies to the following sources: [`file()`]({{< relref "/chapter-sources/configuring-sources-file/_index.md" >}}), [`network()`]({{< relref "/chapter-sources/configuring-sources-network/_index.md" >}}), [`pipe()`]({{< relref "/chapter-sources/source-pipe/_index.md" >}}), [`program()`]({{< relref "/chapter-sources/source-program/_index.md" >}}), [`stdin()`]({{< relref "/chapter-sources/configuring-sources-stdin/_index.md" >}}), [`syslog()`]({{< relref "/chapter-sources/source-syslog/_index.md" >}}), [`systemd-syslog()`]({{< relref "/chapter-sources/source-system/_index.md" >}}), [`unix-dgram()`]({{< relref "/chapter-sources/source-unixstream/_index.md" >}}), [`unix-stream()`]({{< relref "/chapter-sources/source-unixstream/_index.md" >}}), [`wildcard-file()`]({{< relref "/chapter-sources/configuring-sources-wildcard-file/_index.md" >}}). Instead of using the global option, you can also set the `check-hostname()` option for the specific source.
136+
137+
For the [`python()`]({{< relref "/chapter-sources/python-source/_index.md" >}}) and [`python-fetcher()`]({{< relref "/chapter-sources/python-fetcher-source/_index.md" >}}) sources and the [`syslog-parser()`]({{< relref "/chapter-parsers/parser-syslog/_index.md" >}}) parser you can enable this option as a flag.
127138

128139
## create-dirs() {#global-option-create-dirs}
129140

content/chapter-parsers/parser-syslog/parser-syslog-options/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The `syslog-parser()` has the following options:
1414

1515
{{< include-headless "chunk/option-source-flags.md" >}}
1616

17+
For the `syslog-parser()` you can also set the `check-hostname` flag, which is equivalent with the [`check-hostname()` global option]({{< relref "/chapter-global-options/reference-options/_index.md#global-option-check-hostname" >}}), but only applies to this parser.
18+
1719
## sdata-prefix()
1820

1921
| | |

content/chapter-sources/configuring-sources-file/reference-source-file/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 300
66

77
The `file()` driver has the following options:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{< include-headless "chunk/option-source-default-facility.md" >}}
1012

1113
{{< include-headless "chunk/option-source-default-priority.md" >}}

content/chapter-sources/configuring-sources-stdin/stdin()-source-options/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 100
66

77
The `stdin()` driver has the following options:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{% include-headless "chunk/option-source-default-facility.md" %}}
1012

1113
{{% include-headless "chunk/option-source-default-priority.md" %}}

content/chapter-sources/configuring-sources-systemd-syslog/reference-source-systemd-syslog/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ weight: 100
66

77
The `systemd-syslog()` driver has the following options:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{< include-headless "chunk/option-destination-hook.md" >}}

content/chapter-sources/configuring-sources-wildcard-file/reference-source-wildcard-file/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The `wildcard-file()` driver has the following options:
2525

2626
{{% include-headless "chunk/synopsis-wildcard-file-source-example.md" %}}
2727

28+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
29+
2830
{{% include-headless "chunk/option-source-default-facility.md" %}}
2931

3032
{{% include-headless "chunk/option-source-default-priority.md" %}}

content/chapter-sources/python-source/reference-source-python/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ For details, see {{% xref "/chapter-configuration-file/python-code-external-file
4747

4848
{{< include-headless "chunk/option-source-flags.md" >}}
4949

50+
For the `python()` and `python-fetcher()` sources you can also set the `check-hostname` flag, which is equivalent with the [`check-hostname()` global option]({{< relref "/chapter-global-options/reference-options/_index.md#global-option-check-hostname" >}}), but only applies to this source.
51+
5052
The flags and the hostname-related options (for example, `use-dns`) set in the configuration file influence the behavior of the `LogMessage.parse()` method of the Python source. They have no effect if you set the message or the hostname directly, without using `LogMessage.parse()`.
5153

5254

content/chapter-sources/source-pipe/reference-source-pipe/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 100
66

77
The `pipe` driver has the following options:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{% include-headless "chunk/option-destination-create-dirs.md" %}}
1012

1113
{{< include-headless "chunk/option-source-flags.md" >}}

content/chapter-sources/source-program/reference-source-program/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 100
66

77
The `program` driver has the following options:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{< include-headless "chunk/option-source-flags.md" >}}
1012

1113
{{< include-headless "chunk/option-destination-hook.md" >}}

content/chapter-sources/source-unixstream/reference-source-unixstream/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 300
66

77
These two drivers behave similarly: they open an `AF_UNIX` socket and start listening on it for messages. The following options can be specified for these drivers:
88

9+
{{< include-headless "chunk/option-source-check-hostname.md" >}}
10+
911
{{% include-headless "chunk/option-destination-create-dirs.md" %}}
1012

1113
{{% include-headless "chunk/option-source-encoding.md" %}}

0 commit comments

Comments
 (0)