i have 1 main server that ElasticSearch+kibana+logstash installed on.
and i want to monitor 2 apache servers and 1 firewall with this server,
is it possible ? on each server i will install Logstash-Forwarder that will send logs to this main server
is it possible to configure Logstash as a Syslog server and not install another open source like syslog-ng ? it should receive logs from my Juniper Firewall to the main server
Yes, that's what Logstash is meant to do. To be clear, you don't have to use logstash-forwarder. Feature-wise it's less capable than Logstash and it only exists because it has a smaller footprint.
Yes, you can use the syslog input to receive syslog messages. Keep in mind that unless you run Logstash as root (which you shouldn't do) you can't listen on the default port of 514. I'm sure you already have a syslog daemon installed so I don't know if you'll actually be maintaining one less piece of software by having Logstash collect syslog messages too.
but when im define at Kibana the index pattern : logstash-*
how its know which server it is ? i mean
Server-Apache1 will the first that send logs to the main server
Server-Apache2 will the second one that send logs to the main server so how it knows which logstash-* it is ? where i need to configure that
so i will change the port to something else , i will check it tomorrow morning
A properly configured Logstash will extract fields with e.g. the hostname from each input log entry, and you can use that to place queries against the data. A Logstash index typically contains data from multiple sources.
A properly configured Logstash will extract fields with e.g. the hostname from each input log entry, and you can use that to place queries against the data. A Logstash index typically contains data from multiple sources.
i have configures succesfuly Firewall to my Logstash server , i can see at Kibana information
but i cannot understand how im build a filter to those logs , lets say i have a message :
i want that i will have fields like : Source ip , Source Port , Destenation Ip etc... that i will be able to build Dashboard
Okay, but the configuration example I linked to explains exactly how to extract fields from a syslog source which is what you're getting from your firewall. I can see right away that you'll have to adjust the example since the timestamp format is different, but it's the same principle. You'll want to look into the kv filter for parsing your message. It'll take care of most things.
name : fortigate - owned by logstash user and group
my input file :
filter {
if [type] == "syslog" {
grok {
match => ["message", "%{FORTIGATE_52BASE} %{GREEDYDATA:forti_message}"]
}
syslog_pri { }
grok {
match => [
"forti_message", "%{FORTIGATE_52BASE}"
"forti_message", "%{FORTIGATE_52BASEV2}"]
}
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
and im getting this
{:timestamp=>"2015-09-09T01:19:15.695000+0300", :message=>"Error: Expected one of #, {, ,, ] at line 57, column 1 (byte 599) after filter {\n if [type] == "syslog" {\n grok {\nmatch => ["message", "%{FORTIGATE_52BASE} %{GREEDYDATA:forti_message}"]\n } \n\n syslog_pri { }\n\ngrok {\nmatch => [\n"forti_message", "%{FORTIGATE_52BASE}"\n"}
{:timestamp=>"2015-09-09T01:19:15.717000+0300", :message=>"You may be interested in the '--configtest' flag which you can\nuse to validate logstash's configuration before you choose\nto restart a running system."}
Use the http://grokconstructor.appspot.com/do/construction to build your filter and extract field. What i used was to create a rsyslog server and forward all traffic to logstash and logstash will act gather all logs on that connection.
Your FORTIGATE_52BASEV2 pattern doesn't match the message. For example, the message begins with <117> but you're matching a plain integer (without angle brackets) followed by two spaces. Perhaps it would be helpful for you to use http://grokconstructor.appspot.com/ to construct your pattern.
Well at the end i used KV filter as you suggested me at the first time , its working and extracting the fields i wanted , i changed all my configuration
but its extracting me a lot of time messages why ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.