Skip to content

Commit 1d54769

Browse files
author
Robert Fekete
committed
Adds missing @include scl.conf to more http-based destinations
1 parent c399746 commit 1d54769

File tree

5 files changed

+104
-96
lines changed

5 files changed

+104
-96
lines changed

content/chapter-destinations/configuring-destinations-telegram/_index.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,33 @@ The `telegram()` destination sends log messages to [Telegram](https://core.teleg
1010

1111
Note that this destination automatically uses the certificate store of the system (for details, see the [curl documentation](https://curl.se/docs/sslcerts.html)).
1212

13-
1413
## Declaration:
1514

1615
```shell
17-
telegram(parameters);
18-
```
16+
@include "scl.conf"
17+
# ...
1918

19+
telegram(parameters);
20+
```
2021

2122
{{% include-headless "chunk/destination-http-proxy-settings.md" %}}
2223

23-
2424
## Example: Using the telegram() driver {#example-destination-mongodb}
2525

2626
The following example creates a `telegram()` destination.
2727

2828
```shell
29-
destination d_telegram {
30-
telegram(
31-
template("${MESSAGE}")
32-
throttle(1)
33-
parse-mode("markdown")
34-
disable-web-page-preview("true")
35-
bot-id("<bot id>")
36-
chat-id("<chat id>")
37-
);
38-
};
29+
@include "scl.conf"
30+
# ...
31+
32+
destination d_telegram {
33+
telegram(
34+
template("${MESSAGE}")
35+
throttle(1)
36+
parse-mode("markdown")
37+
disable-web-page-preview("true")
38+
bot-id("<bot id>")
39+
chat-id("<chat id>")
40+
);
41+
};
3942
```
40-

content/chapter-destinations/destination-discord/_index.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,44 @@ The `discord()` destination driver sends messages to [Discord](https://discord.c
1010

1111
Available in {{% param "product.abbrev" %}} version 3.33 and later.
1212

13-
1413
## Declaration:
1514

1615
```shell
17-
destination {
18-
discord(url("https://discord.com/api/webhooks/x/y"));
19-
};
16+
@include "scl.conf"
17+
# ...
18+
19+
destination {
20+
discord(url("https://discord.com/api/webhooks/x/y"));
21+
};
2022
```
2123

2224
By default the message sending is throttled to 5 message/sec, see [Discord: Rate Limits](https://discord.com/developers/topics/rate-limits#global-rate-limit). To change this, use the `throttle()` option.
2325

2426
To use this destination, the `scl.conf` file must be included in your {{% param "product.abbrev" %}} configuration:
2527

2628
```shell
27-
@include "scl.conf"
29+
@include "scl.conf"
2830
```
2931

3032
The `discord()` driver is actually a reusable configuration snippet configured to send log messages using the `http()` driver. For details on using or writing such configuration snippets, see Reusing configuration blocks. You can find the source of this configuration snippet on GitHub.
3133

32-
33-
3434
## Prerequisites
3535

3636
To send messages to Discord, you must setup webhooks. For details, see: [Discord: Intro to Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks).
3737

38-
39-
4038
## Example: Using the discord() driver {#example-destination-collectd}
4139

4240
The following example sends messages with custom avatar, and text-to-speech enabled.
4341

4442
```shell
45-
@include "scl.conf"
46-
destination d_discord {
47-
discord(
48-
url("https://discord.com/api/webhooks/x/y")
49-
avatar-url("https://example.domain/any_image.png")
50-
username("$HOST-bot") # Custom bot name, accepts macros
51-
tts(true) # Text-to-Speech message
52-
template("${MSG:-[empty message]}") # Message to send, can't be empty
53-
);
54-
ó}
43+
@include "scl.conf"
44+
destination d_discord {
45+
discord(
46+
url("https://discord.com/api/webhooks/x/y")
47+
avatar-url("https://example.domain/any_image.png")
48+
username("$HOST-bot") # Custom bot name, accepts macros
49+
tts(true) # Text-to-Speech message
50+
template("${MSG:-[empty message]}") # Message to send, can't be empty
51+
);
52+
}
5553
```
56-

content/chapter-destinations/destination-opensearch/_index.md

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,65 @@ The `opensearch()` destination can directly post log messages to [OpenSearch](ht
1212

1313
HTTPS connection, as well as password- and certificate-based authentication is supported. The content of the events is sent in JSON format.
1414

15-
1615
## Declaration:
1716

1817
```shell
19-
d_opensearch {
20-
opensearch(
21-
index("<opensearch-index-to-store-messages>")
22-
url("https://your-opensearch-endpoint:9200/_bulk")
23-
);
24-
};
18+
@include "scl.conf"
19+
# ...
20+
21+
d_opensearch {
22+
opensearch(
23+
index("<opensearch-index-to-store-messages>")
24+
url("https://your-opensearch-endpoint:9200/_bulk")
25+
);
26+
};
2527
```
2628

2729
## Example: Sending log data to OpenSearch {#example-destination-opensearch}
2830

2931
The following example defines an `opensearch()` destination, with only the required options.
3032

3133
```shell
32-
destination opensearch {
33-
opensearch(
34-
index("<name-of-the-index>")
35-
url("http://my-elastic-server:9200/_bulk")
36-
);
37-
};
38-
39-
40-
log {
41-
source(s_file);
42-
destination(d_opensearch_http);
43-
flags(flow-control);
44-
};
34+
@include "scl.conf"
35+
# ...
36+
37+
destination opensearch {
38+
opensearch(
39+
index("<name-of-the-index>")
40+
url("http://my-elastic-server:9200/_bulk")
41+
);
42+
};
43+
44+
45+
log {
46+
source(s_file);
47+
destination(d_opensearch_http);
48+
flags(flow-control);
49+
};
4550
```
4651

4752
The following example uses mutually-authenticated HTTPS connection, templated index, and also sets some other options.
4853

4954
```shell
50-
destination opensearch_https {
51-
opensearch(
52-
url("https://node01.example.com:9200/_bulk")
53-
index("test-${YEAR}${MONTH}${DAY}")
54-
time-zone("UTC")
55-
workers(4)
56-
batch-lines(16)
57-
timeout(10)
58-
tls(
59-
ca-file("ca.pem")
60-
cert-file("syslog_ng.crt.pem")
61-
key-file("syslog_ng.key.pem")
62-
peer-verify(yes)
63-
)
64-
);
65-
};
55+
@include "scl.conf"
56+
# ...
57+
58+
destination opensearch_https {
59+
opensearch(
60+
url("https://node01.example.com:9200/_bulk")
61+
index("test-${YEAR}${MONTH}${DAY}")
62+
time-zone("UTC")
63+
workers(4)
64+
batch-lines(16)
65+
timeout(10)
66+
tls(
67+
ca-file("ca.pem")
68+
cert-file("syslog_ng.crt.pem")
69+
key-file("syslog_ng.key.pem")
70+
peer-verify(yes)
71+
)
72+
);
73+
};
6674
```
6775

6876
This driver is actually a reusable configuration snippet configured to send log messages using the `http()` driver using a template. For details on using or writing such configuration snippets, see {{% xref "/chapter-configuration-file/large-configs/config-blocks/_index.md" %}}. You can find the source of this configuration snippet on [GitHub](https://github.com/axoflow/axosyslog/tree/master/scl/opensearch).

content/chapter-destinations/destination-slack/_index.md

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ short_description: "Send alerts and notifications to a Slack channel"
88

99
The `slack()` destination driver sends messages to a [Slack](https://slack.com/) channel using the Slack Web API. For the list of available optional parameters, see {{% xref "/chapter-destinations/destination-slack/reference-destination-slack/_index.md" %}}. This destination is available in version 3.19 and later.
1010

11-
1211
## Declaration:
1312

1413
```shell
15-
destination d_slack {
16-
slack(
17-
hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
18-
);
19-
};
14+
@include "scl.conf"
15+
# ...
16+
17+
destination d_slack {
18+
slack(
19+
hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
20+
);
21+
};
2022
```
2123

22-
2324
The driver allows you to modify nearly every field of the HTTP request. For details, see the [Slack API documentation](https://api.slack.com/docs).
2425

2526
{{% include-headless "chunk/destination-http-proxy-settings.md" %}}
2627

2728
{{% include-headless "chunk/option-description-destination-slack-throttle.md" %}}
2829

29-
3030
To use this destination, the `scl.conf` file must be included in your {{% param "product.abbrev" %}} configuration:
3131

3232
```shell
@@ -35,30 +35,25 @@ To use this destination, the `scl.conf` file must be included in your {{% param
3535

3636
The `slack()` driver is actually a reusable configuration snippet configured to send log messages using the `http()` driver. For details on using or writing such configuration snippets, see {{% xref "/chapter-configuration-file/large-configs/config-blocks/_index.md" %}}. You can find the source of this configuration snippet on [GitHub](https://github.com/axoflow/axosyslog/blob/master/scl/slack/slack.conf).
3737

38-
39-
4038
## Prerequisites {#slack-destination-prerequisites}
4139

4240
To send messages and notifications from {{% param "product.abbrev" %}} to Slack, you must create a Slack app and a Webhook that {{% param "product.abbrev" %}} can use. For details, see the [Slack documentation](https://api.slack.com/incoming-webhooks).
4341

44-
45-
4642
## Example: Using the slack() driver {#example-destination-slack}
4743

4844
The following example sets the colors and the author of the message.
4945

5046
```shell
51-
@include "scl.conf"
52-
53-
destination d_slack1 {
54-
slack(
55-
hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
56-
colors("#000000,#222222,#444444,#666666,#888888,#AAAAAA,#CCCCCC,#EEEEEE")
57-
color-chooser(7)
58-
author-name("Example BOT")
59-
author-link("https://www.syslog-ng.com/products/open-source-log-management")
60-
author-icon("https://raw.githubusercontent.com/MrAnno/vscode-syslog-ng/master/images/syslog-ng-icon.png")
61-
);
62-
};
47+
@include "scl.conf"
48+
49+
destination d_slack1 {
50+
slack(
51+
hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
52+
colors("#000000,#222222,#444444,#666666,#888888,#AAAAAA,#CCCCCC,#EEEEEE")
53+
color-chooser(7)
54+
author-name("Example BOT")
55+
author-link("https://www.syslog-ng.com/products/open-source-log-management")
56+
author-icon("https://raw.githubusercontent.com/MrAnno/vscode-syslog-ng/master/images/syslog-ng-icon.png")
57+
);
58+
};
6359
```
64-

content/chapter-destinations/syslog-ng-with-splunk/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ The `splunk-hec-event()` destination feeds Splunk via the [HEC events API](https
2222
Minimal configuration:
2323

2424
```sh
25+
@include "scl.conf"
26+
# ...
27+
2528
destination d_splunk_hec_event {
2629
splunk-hec-event(
2730
url("https://localhost:8088")
@@ -66,6 +69,9 @@ The `splunk-hec-raw()` destination feeds Splunk via the [HEC raw API](https://do
6669
Minimal configuration:
6770

6871
```sh
72+
@include "scl.conf"
73+
# ...
74+
6975
destination d_splunk_hec_raw {
7076
splunk-hec-raw(
7177
url("https://localhost:8088")

0 commit comments

Comments
 (0)