Fix log grep example

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2020-01-27 16:18:06 +01:00
parent 10e4cd4f6b
commit 66942c4c88
3 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Hello World! Example
# Hello World!
A simple "Hello World!" type example.
+3
View File
@@ -0,0 +1,3 @@
kapow route add /apache-errors - <<-'EOF'
cat /var/log/apache2/access.log | grep 'File does not exist' | kapow set /response/body
EOF
+19
View File
@@ -0,0 +1,19 @@
# Fix Log Grep as a Service
A simple service that exposes log entries for files not found on our Apache Web Server.
## How to run it
```
$ kapow server FixLogGrep.pow
```
## How to consume it
```
$ curl http://apache-host:8080/apache-errors
[Fri Feb 01 22:07:57.154391 2019] [core:info] [pid 7:tid 140284200093440] [client 172.17.0.1:50756] AH00128: File does not exist: /usr/var/www/mysite/favicon.ico
[Fri Feb 01 22:07:57.808291 2019] [core:info] [pid 8:tid 140284216878848] [client 172.17.0.1:50758] AH00128: File does not exist: /usr/var/www/mysite/favicon.ico
[Fri Feb 01 22:07:57.878149 2019] [core:info] [pid 8:tid 140284208486144] [client 172.17.0.1:50758] AH00128: File does not exist: /usr/var/www/mysite/favicon.ico
```