1
resposta

Não consegui acessar os arquivos de log

Ola Galera blz!!!

Eu tenho o seguinte log:

127.0.0.1 [12/Dec/2019:15:32:23 -0200] "GET /v2/api-docs HTTP/1.1" 200 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

o telegraf não esta conseguindo enviar para influxDB

segue minha configuracao do telegraf:

 [[inputs.logparser]]
#   ## Log files to parse.
#   ## These accept standard unix glob matching rules, but with the addition of
#   ## ** as a "super asterisk". ie:
#   ##   /var/log/**.log     -> recursively find all .log files in /var/log
#   ##   /var/log/*/*.log    -> find all .log files with a parent dir in /var/log
#   ##   /var/log/apache.log -> only tail the apache log file
   files = ["/home/tpereira/bkp/curso_monitoramento/log_exemplo/acesslog.log"]
#
#   ## Read files that currently exist from the beginning. Files that are created
#   ## while telegraf is running (and that match the "files" globs) will always
#   ## be read from the beginning.
   from_beginning = false
#
#   ## Method used to watch for file updates.  Can be either "inotify" or "poll".
#   # watch_method = "inotify"
#
#   ## Parse logstash-style "grok" patterns:
   [inputs.logparser.grok]
#     ## This is a list of patterns to check the given log file(s) for.
#     ## Note that adding patterns here increases processing time. The most
#     ## efficient configuration is to have one pattern per logparser.
#     ## Other common built-in patterns are:
#     ##   %{COMMON_LOG_FORMAT}   (plain apache & nginx access logs)
#     ##   %{COMBINED_LOG_FORMAT} (access logs + referrer & agent)
     patterns = ["%{COMBINED_LOG_FORMAT}"]
#
#     ## Name of the outputted measurement name.
     measurement = "apache_access_log"

Tem mais alguma configuração que precisa ser feita o docker do influxdb esta rodando normalmente.

1 resposta

Olá Thiago, tudo bem? Peço desculpas pela demora em ti responder! Bem precisamos entender, você instalou o apache na máquina e tentou fazer a leitura do arquivo de logs? O que eu posso identificar é o grafana recupera e mostra os dados de acordo com o intervalo de tempo que foi determinado lá no dashboard, e pode ser que esse log já esteja fora do tempo determinado e assim não esteja sendo exibido no dashboard. Tenta realizar a instalação do Apache como o professor fez no vídeo e exibir os logs dele, caso não funcione fala aqui!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software