You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: how-to-guides/splunk-like-grep-and-alert-email.md
+18-20Lines changed: 18 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,28 @@
1
1
# Email Alerting like Splunk
2
2
3
-
[Splunk](http://www.splunk.com/) is a great tool for searching logs. One of its key features is the ability to `grep` logs and send alert emails when certain conditions are met.
3
+
[Splunk](https://www.splunk.com/) is a great tool for searching logs. One of its key features is the ability to `grep` logs and send alert emails when certain conditions are met.
4
4
5
5
In this little HowTo article, we will show you how to build a similar system using Fluentd. More specifically, we will create a system that sends an alert email when it detects a 5xx HTTP status code in an Apache access log.
6
6
7
7
If you want a more general introduction to use Fluentd as a free alternative to Splunk, see the article ["Free Alternative to Splunk Using Fluentd"](free-alternative-to-splunk-by-fluentd.md).
8
8
9
-
## Installing the Requisites
9
+
## Prerequisites
10
10
11
-
[Install](../installation/) Fluentd if you haven't yet.
11
+
The following software/services are required to be set up correctly:
12
12
13
-
Please install `fluent-plugin-grepcounter` by running:
If `out_grepcounter` (fluent-plugin-grepcounter) and `out_mail` (fluent-plugin-mail) are not installed yet, please install it manually.
24
24
25
-
Note: If you installed Fluentd using RubyGems, use `gem` command instead of `td-agent-gem`.
25
+
See [Plugin Management](..//installation/post-installation-guide#plugin-management) section how to install fluent-plugin-mongo on your environment.
26
26
27
27
## Configuration
28
28
@@ -70,7 +70,7 @@ Here is the full configuration example \(copy and edit as needed\):
70
70
</match>
71
71
```
72
72
73
-
Save your settings to `/etc/td-agent/td-agent.conf`\(If you installed Fluentd without `td-agent`, save the content as `alert-email.conf` instead\).
73
+
Save your settings to `/etc/fluent/fluentd.conf`\(If you installed Fluentd without `fluent-package`, save the content as `alert-email.conf` instead\).
74
74
75
75
Before proceeding, please confirm:
76
76
@@ -80,7 +80,7 @@ Before proceeding, please confirm:
80
80
81
81
* The access log file has proper file permission. You need to make
82
82
83
-
the file readable to the `td-agent`/`fluentd` daemon.
83
+
the file readable to the `fluentd` daemon.
84
84
85
85
### How this Configuration Works
86
86
@@ -94,13 +94,11 @@ In this way, fluentd now works as an email alerting system that monitors the web
94
94
95
95
## Test the Configuration
96
96
97
-
After saving the configuration, restart the `td-agent` process:
97
+
After saving the configuration, restart the `fluentd` process:
98
98
99
99
```text
100
-
# for init.d users
101
-
$ sudo /etc/init.d/td-agent restart
102
100
# for systemd users
103
-
$ sudo systemctl restart td-agent
101
+
$ sudo systemctl restart fluentd
104
102
```
105
103
106
104
If you installed the standalone version of Fluentd, launch the `fluentd` process manually:
@@ -119,8 +117,8 @@ Admittedly, this is a contrived example. In reality, you would set the threshold
119
117
120
118
You can learn more about Fluentd and its plugins by:
121
119
122
-
* exploring other [plugins](http://fluentd.org/plugin/)
123
-
* asking questions on the [mailing list](https://groups.google.com/forum/#!forum/fluentd)
120
+
* exploring other [plugins](https://fluentd.org/plugin/)
121
+
* asking questions on the [GitHub Discussions](https://github.com/fluent/fluentd/discussions)
124
122
*[signing up for our newsletters](https://www.fluentd.org/newsletter)
125
123
126
124
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.
0 commit comments