This is a demo project for uploading Apache access log to a rest service.
-
CentOS 7
-
Apache
$ sudo yum install httpd $ sudo systemctl start httpd $ tail -f /var/log/httpd/access_log
-
Java
-
Gradle
$ cd <project-root>/test-springboot $ ./gradlew clean bootRun
-
Logstash
$ cd <project-root> $ wget https://download.elastic.co/logstash/logstash/logstash-2.3.4.zip $ unzip logstash-2.3.4.zip $ cd logstash-2.3.4 $ ./bin/logstash -f ../logstashconf/apache2rest.conf
Note that the above access log need to use default log format and path. Otherwise update the Logstash config accordingly.
-
Ping Apache server (we should see access log rolling)
$ curl http://localhost/aaa
-
Check the result from rest server
$ curl http://localhost:8080/log
-
Logstash documentation: Apache log and out http.
-
Further work on trigger http requests via http poller and email notification via email.