Skip to content

Commit 07b1b15

Browse files
authored
Update graylog howto for fluent-package (#558)
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent 2541f20 commit 07b1b15

File tree

8 files changed

+102
-143
lines changed

8 files changed

+102
-143
lines changed

.gitbook.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ redirects:
155155
v1.0/articles/parse-syslog: guides/parse-syslog.md
156156
v1.0/articles/http-to-hdfs: guides/http-to-hdfs.md
157157
v1.0/articles/kinesis-stream: guides/kinesis-stream.md
158-
v1.0/articles/graylog2: guides/graylog2.md
158+
# redirect renamed graylog guide
159+
v1.0/articles/graylog2: how-to-guides/graylog.md
159160
v1.0/articles/apache-to-s3: guides/apache-to-s3.md
160161
v1.0/articles/syslog-influxdb: guides/syslog-influxdb.md
161162
v1.0/articles/splunk-like-grep-and-alert-email: guides/splunk-like-grep-and-alert-email.md

.gitbook/assets/graylog-graph.png

223 KB
Loading

.gitbook/assets/graylog-input.png

153 KB
Loading

.gitbook/assets/graylog2-graph.png

-59.8 KB
Binary file not shown.

.gitbook/assets/graylog2-input.png

-52.2 KB
Binary file not shown.

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
* [Send Apache Logs to S3](how-to-guides/apache-to-s3.md)
151151
* [Send Apache Logs to Minio](how-to-guides/apache-to-minio.md)
152152
* [Send Apache Logs to Mongodb](how-to-guides/apache-to-mongodb.md)
153-
* [Send Syslog Data to Graylog](how-to-guides/graylog2.md)
153+
* [Send Syslog Data to Graylog](how-to-guides/graylog.md)
154154
* [Send Syslog Data to InfluxDB](how-to-guides/syslog-influxdb.md)
155155
* [Send Syslog Data to Sematext](how-to-guides/logs-to-sematext.md)
156156
* [Data Analytics with Treasure Data](how-to-guides/http-to-td.md)

how-to-guides/graylog.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Send Syslog Data to Graylog
2+
3+
This article explains how to set up Fluentd with [Graylog](https://www.graylog.org). Graylog is a popular log management server powered by Elasticsearch and MongoDB. You can combine Fluentd and Graylog to create a scalable log analytics pipeline.
4+
5+
## Prerequisites
6+
7+
* Basic Understanding of Fluentd
8+
* Linux Server (Ubuntu 24.04 LTS is not supported yet. Use 20.04 or 22.04)
9+
* [Fluentd](https://www.fluentd.org/)
10+
* [MongoDB Community Server](https://www.mongodb.com/try/download/community), Use 7.0.
11+
* [Graylog](https://graylog.org/), Use 6.1.
12+
13+
<!-- Ubuntu 24.04LTS is not officially supported for Graylog2 6.0-->
14+
15+
You can install Fluentd via major packaging systems.
16+
17+
* [Installation](../installation/)
18+
19+
You can install MongoDB via major packaging systems.
20+
21+
* [MongoDB Community Server](https://www.mongodb.com/try/download/community)
22+
23+
{% hint style='warning' %}
24+
Use MongoDB 7.x because Graylog 6.1 does not support MongoDB 8.x.
25+
{% endhint %}
26+
27+
You can install Graylog Data Node and Server on Ubuntu.
28+
29+
* [Ubuntu Installation](https://go2docs.graylog.org/current/downloading_and_installing_graylog/ubuntu_installation.htm)
30+
31+
### Prepare Graylog for Fluentd
32+
33+
Go to [http://localhost:9000](http://localhost:9000) and log into the web interface.
34+
35+
To log in, use `admin` as the username and `YOUR_PASSWORD` as the password \(the one you have set up for `root_password_sha2`\).
36+
37+
Once logged in, click on `System` in the top nav. Next, click on `Inputs` from the left navigation bar. \(Or, simply go to [http://localhost:9000/system/inputs](http://localhost:9000/system/inputs).
38+
39+
Then, from the dropdown, choose `GELF UDP` and click on `Launch new input`, which should pop up a modal dialogue, Select the `Node` and fill the `Title`. Then, click `Save`.
40+
41+
![Graylog Inputs](../.gitbook/assets/graylog-input.png)
42+
43+
Now, Graylog is ready to accept messages from Fluentd over UDP. It is time to configure Fluentd.
44+
45+
{% hint style='info' %}
46+
There might be a case that modal dialogue will not shown when clicking `Launch new input`. Check your browser configuration.
47+
{% endhint %}
48+
49+
### Fluentd
50+
51+
You can install Fluentd via major packaging systems.
52+
53+
* [Installation](../installation/)
54+
55+
#### Install MongoDB Plugin
56+
57+
If `out_gelf` (fluent-plugin-gelf-hs) is not installed yet, please install it manually.
58+
59+
See [Plugin Management](..//installation/post-installation-guide#plugin-management) section how to install fluent-plugin-gelf-hs on your environment.
60+
61+
Then, configure `/etc/fluent/fluentd.conf` as follows:
62+
63+
```text
64+
<source>
65+
@type syslog
66+
tag graylog
67+
</source>
68+
69+
<match graylog.**>
70+
@type gelf
71+
host 127.0.0.1
72+
port 12201
73+
<buffer>
74+
flush_interval 5s
75+
</buffer>
76+
</match>
77+
```
78+
79+
Create `/etc/rsyslog.d/90-fluentd.conf` and add the following line to the file:
80+
81+
```text
82+
*.* @127.0.0.1:5140
83+
```
84+
85+
Finally, restart `rsyslog` and Fluentd with the following commands:
86+
87+
```text
88+
$ sudo systemctl restart rsyslog
89+
$ sudo systemctl restart fluentd
90+
```
91+
92+
## Visualize the Data Stream
93+
94+
When you log back into Graylog, you should be seeing a graph like this \(wait for events to flow in\):
95+
96+
![Graylog Graph](../.gitbook/assets/graylog-graph.png)
97+
98+
If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.
99+

how-to-guides/graylog2.md

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)