Skip to content

Commit 0a46b0a

Browse files
authored
Update splunk like grep and alert email for fluent-package (#549)
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent 5f8c1dc commit 0a46b0a

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

how-to-guides/splunk-like-grep-and-alert-email.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# Email Alerting like Splunk
22

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.
44

55
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.
66

77
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).
88

9-
## Installing the Requisites
9+
## Prerequisites
1010

11-
[Install](../installation/) Fluentd if you haven't yet.
11+
The following software/services are required to be set up correctly:
1212

13-
Please install `fluent-plugin-grepcounter` by running:
13+
* [Fluentd](https://www.fluentd.org/)
14+
* [Grep Counter Output Plugin](https://github.com/fluent-plugins-nursery/fluent-plugin-grepcounter) (fluent-plugin-grepcounter)
15+
* [Mail Output Plugin](https://github.com/u-ichi/fluent-plugin-mail) (fluent-plugin-mail)
1416

15-
```text
16-
$ sudo /usr/sbin/td-agent-gem install fluent-plugin-grepcounter
17-
```
17+
You can install Fluentd via major packaging systems.
1818

19-
Next, please install `fluent-plugin-mail` by running:
19+
* [Installation](../installation/)
2020

21-
```text
22-
$ sudo /usr/sbin/td-agent-gem install fluent-plugin-mail
23-
```
21+
### Install Grep Counter/Mail Plugin
22+
23+
If `out_grepcounter` (fluent-plugin-grepcounter) and `out_mail` (fluent-plugin-mail) are not installed yet, please install it manually.
2424

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.
2626

2727
## Configuration
2828

@@ -70,7 +70,7 @@ Here is the full configuration example \(copy and edit as needed\):
7070
</match>
7171
```
7272

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\).
7474

7575
Before proceeding, please confirm:
7676

@@ -80,7 +80,7 @@ Before proceeding, please confirm:
8080

8181
* The access log file has proper file permission. You need to make
8282

83-
the file readable to the `td-agent`/`fluentd` daemon.
83+
the file readable to the `fluentd` daemon.
8484

8585
### How this Configuration Works
8686

@@ -94,13 +94,11 @@ In this way, fluentd now works as an email alerting system that monitors the web
9494

9595
## Test the Configuration
9696

97-
After saving the configuration, restart the `td-agent` process:
97+
After saving the configuration, restart the `fluentd` process:
9898

9999
```text
100-
# for init.d users
101-
$ sudo /etc/init.d/td-agent restart
102100
# for systemd users
103-
$ sudo systemctl restart td-agent
101+
$ sudo systemctl restart fluentd
104102
```
105103

106104
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
119117

120118
You can learn more about Fluentd and its plugins by:
121119

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)
124122
* [signing up for our newsletters](https://www.fluentd.org/newsletter)
125123

126124
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

Comments
 (0)