Bonjour,
J'ai installé sur mon PC, pour la testé, une solution Elasticsearch/Logstash/Kibana. Malheureusement, logstash n'alimente pas l'indexeur avec le contenu des fichiers de log que j'ai spécifier dans la configuration et je ne vois aucune erreur dans logstash ou elasticsearch. Je sais qu'il n'y a pas de log dans l'indexeur, car kibana ne les trouves pas.
Je me suis basé sur les tutoriels suivant pour installer et configurer cette solution:
https://www.ulyaoth.net/resources/tu...th-rsyslog.45/
https://www.digitalocean.com/communi...-4-on-centos-7
Concernant le premier tuto, je l'ai surtout utilisé pour la configuration de l'accès aux dépots.
Ma machine fonctionne avec un Fedora Linux 21 64 bit.
Voici la configuration de logstash:
- Fichier 01-file-input.conf
- Fichier 10-apache.conf
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 input { file { path => "/var/log/httpd/access_log" exclude => ["*.gz", "*.bz2"] type => "apache_access" start_position => beginning } # file { # path => "/var/log/httpd/access_log*" # exclude => ["*.gz", "*.bz2"] # type => "apache_access" # start_position => beginning # } # file { # path => "/var/log/httpd/error_log*" # exclude => ["*.gz", "*.bz2"] # type => "apache_error" # start_position => beginning # } # file { # path => "/var/log/httpd/ssl_access_log*" # exclude => ["*.gz", "*.bz2"] # type => "apache_ssl_access" # start_position => beginning # } # file { # path => "/var/log/httpd/ssl_error_log*" # exclude => ["*.gz", "*.bz2"] # type => "apache_ssl_error" # start_position => beginning # } # file { # path => "/var/log/httpd/ssl_request_log*" # exclude => ["*.gz", "*.bz2"] # type => "apache_ssl_request" # start_position => beginning # } }
- Fichier 30-apache-output.conf
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 filter { if [type] == "apache_access" { grok { match => { "message" => "%{COMBINEDAPACHELOG}" } add_field => {"received_from" => "localhost" } } date { match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] } } # if [type] == "apache_access" or [type] == "ssl_access" { # grok { # match => { "message" => "%{COMBINEDAPACHELOG}" } # add_field => {"received_from" => "localhost" } # } # date { # match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] # } # } # if [type] == "apache_error" or [type] == "ssl_error" { # grok { # match => { "message" => "\[%{DATESTAMP_OTHER:error_timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{NUMBER:pid}\] %{GREEDYDATA:error_message}" } # add_field => {"received_from" => "localhost" } # } # date { # match => [ "error_timestamp", "EEE MMM d HH:mm:ss.S yyyy" ] # } # } # if [type] == "apache_ssl_request" { # grok { # match => {"message" => "\[%{DATESTAMP_OTHER:ssl_request_timestamp}\] %{IPORHOST:host} %{GREEDYDATA:ssl_request_message}" } # add_field => {"received_from" => "localhost" } # } # date { # match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] # } # } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 output { elasticsearch { host => localhost protocol => http cluster => roland } stdout { codec => rubydebug } }
Une idée sur ce qui pourrait bloquer?
Merci.
Partager