2017-10-11 1 views
0

Ich kann die Indizes mit logstash.conf erstellen. Mein Eingabetyp ist gelf. Ich sende die Logstash Logs an Kibana. Hier ist meine logstash.confNicht in der Lage, die Indizes bezogenen Daten in Kibana

input 
{ gelf { } 
} 
output 

{ 
stdout { codec => rubydebug } 
elasticsearch { 
    hosts => ["elk.lera.com:80"] 
    index => "templeton-math-%{+YYYY.MM.dd}" 
} 

elasticsearch { 
    hosts => ["elk.lera.com:80"] 
    index => "templeton-science-%{+YYYY.MM.dd}" 
} 
elasticsearch { 
    hosts => ["elk.lera.com:80"] 
    index => "templeton-bio-%{+YYYY.MM.dd}" 
} 
elasticsearch { 
    hosts => ["elk.lera.com:80"] 
    index => "templeton-lang-%{+YYYY.MM.dd}" 
} 
} 

Ausgabe: Protokolle werden nun an alle Indizes gesendet. Ich möchte die Protokolle an die entsprechenden Indizes senden.

Ich habe hinzugefügt, wie

if[tag] == "templeton-math"{ 
elasticsearch { 
    hosts => ["elk.lera.com:80"] 
    index => "templeton-math-%{+YYYY.MM.dd}" 
} 
} 

Es ist ein Fehler INFO logstash.agent geben - keine persistenten UUID-Datei gefunden. Neue UUID erzeugen {: uuid => "67f7a48e-fc7c-499b-85a0-3fd6979f88f6",: Pfad => "/ var/lib/logstash/uuid"} 14: 58: 14.308 [LogStash :: Runner] FEHLER logstash. Agent - Kann Pipeline {: reason => "Erwartetes von #, => in Zeile 22, Spalte 9 (Byte 179) nach Ausgabe nicht erstellen \ n \ n {\ n \ n elasticsearch {\ n Hosts"} 2017-10 -11 14: 58: 14.355 Api Webserver FEHLER Keine log4j2 Konfigurationsdatei gefunden. Standardkonfiguration verwenden: Nur Fehler in der Konsole protokollieren.

+0

Bitte fügen Sie Ihre endgültige Logstash-Konfigurationsdatei ein, nachdem Sie alle entsprechenden ES-Hosts hinzugefügt haben. –

Antwort

0

Versuchen Sie dies.

output { 
    stdout { codec => rubydebug } 

    if [tag] == "templeton-math" { 
     elasticsearch { 
      hosts => ["elk.lera.com:80"] 
      index => "templeton-math-%{+YYYY.MM.dd}" 
     } 
    } 

    if [tag] == "templeton-science" { 
     elasticsearch { 
      hosts => ["elk.lera.com:80"] 
      index => "templeton-science-%{+YYYY.MM.dd}" 
     } 
    } 

    if [tag] == "templeton-bio" { 
     elasticsearch { 
      hosts => ["elk.lera.com:80"] 
      index => "templeton-bio-%{+YYYY.MM.dd}" 
     } 

    } 

    if [tag] == "templeton-lang" { 
     elasticsearch { 
      hosts => ["elk.lera.com:80"] 
      index => "templeton-lang-%{+YYYY.MM.dd}" 
     } 
    } 
}