ssh user@server
tail -f /var/log/*
138.117.63.162 - - [08/Dec/2017:11:00:47 -0200] "POST /sistema/notificacao HTTP/1.1" 200 114 "https://exemplo.com.br/home" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" "-"
201.81.5.18 - - [08/Dec/2017:11:00:48 -0200] "POST /sistema/notificacao HTTP/1.1" 200 10753 "https://exemplo.com.br/sistema" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0" "-"
179.126.128.202 - - [08/Dec/2017:11:00:48 -0200] "GET /api/portais HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Linux; Android 7.0; Moto G (4) Build/NPJS25.93-14-10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/62.0.3202.84 Mobile Safari/537.36" "-"
201.48.147.153 - - [08/Dec/2017:11:00:49 -0200] "GET /sistema/get-chat-mensagens/cliente/2403/mensagem/790652?type=nao-lidas&ultimaMensagem={%22nu_timestamp%22:%222017-12-08%2009:43:54.35097%22,%22dt_comunicado%22:%222017-12-08%2009:41:21%22} HTTP/1.1" 200 258 "https://exemplo.com.br/sistema" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36" "-"
138.117.63.162 - - [08/Dec/2017:11:00:49 -0200] "GET /index HTTP/1.1" 200 12204 "https://exemplo.com.br/home" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" "-"
191.35.175.75 - - [08/Dec/2017:11:00:50 -0200] "POST /sistema/notificacao HTTP/1.1" 200 114 "https://exemplo.com.br/index" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0" "-"
ssh user@server
cat /var/log/* | grep '138.117.63.162'
138.117.63.162 - - [08/Dec/2017:15:32:21 -0200] "POST /sistema/notificacao HTTP/1.1" 200 114 "https://exemplo.com.br/index" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" "-"
138.117.63.162 - - [08/Dec/2017:11:00:49 -0200] "GET /index HTTP/1.1" 200 12204 "https://exemplo.com.br/home" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" "-"
ssh user@server
cat /var/log/* | awk '{print $6, $8, $9, $7}'
"GET HTTP/1.1" 200 /sistema/get-chat-mensagens/cliente/378/mensagem/791594?type=nao-lidas&ultimaMensagem=
"GET HTTP/1.1" 200 /sistema/get-chat-licitacao/cliente/378/mensagem/791594
"GET HTTP/1.1" 301 /
"GET HTTP/1.1" 200 /
"GET HTTP/1.1" 200 /sistema/get-chat-licitacao/cliente/534/mensagem/789797
"POST HTTP/1.1" 200 /sistema/notificacao
"GET HTTP/1.1" 301 /
"GET HTTP/1.1" 200 /
"GET HTTP/1.1" 200 /sistema/get-chat-mensagens/cliente/534/mensagem/789797?type=nao-lidas&ultimaMensagem=
Centralize seus logs
---
version: '3.0'
services:
logstash:
image: docker.elastic.co/logstash/logstash:6.0.1
volumes:
- ./logstash/pipeline/:/usr/share/logstash/pipeline/
networks:
- elastic-stack
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.0.1
networks:
- elastic-stack
kibana:
image: docker.elastic.co/kibana/kibana:6.0.1
ports: [ '5601:5601' ]
networks:
- elastic-stack
filebeat:
image: docker.elastic.co/beats/filebeat:6.0.1
volumes:
- ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
- ./filebeat/log:/mnt/log/
- ./filebeat/prospectors.d/:/usr/share/filebeat/prospectors.d/
networks:
- elastic-stack
networks:
elastic-stack:
docker-compose up -d