I've got it working though it seems I lose fields like "logsource" and "program" and "facility_label". Is that normal?
ucemike, please bear with me as this issue is a little more complicated than it seems at first - I'll try and describe it as clearly as possible.
When Logstash waits for information, it listens on its 'input' - a listener that takes in whatever data remote clients send it. From the input, the data is passed to Logstash filters - and from filters pushed through outputs into the elasticsearch database.
Let's say we set up the following input:
Code: Select all
tcp {
type => 'solarisin'
port => 9001
}
'tcp' is the logstash input - this can also be 'udp' and 'syslog'. These are the three most common inputs. This tcp input by default listens on a tcp port - which is defined by the 'port' parameter. tcp/9001.
The 'type' field is an arbitrary tag that is given to any logs entering the input. This tag is only really used with regards to logstash filters. This is an example of a logstash filter:
Code: Select all
if [type] == "solarisin" {
then blah blah blah
You can see that 'type' does not mean anything - it can be any string. The main purpose for the 'type' is to match a filter to logs entering through the input.
What you want to change is the logstash input. For example, your input currently might look something like this:
Code: Select all
udp {
type => 'solarisin'
port => 9001
}
If you want to switch it to the syslog input, simply make the following change:
Code: Select all
syslog {
type => 'solarisin'
port => 9001
}
The syslog input is a tcp/udp listener that will apply its own custom 'syslog' filter before
any other filters are applied. This custom syslog filter pulls fields like 'logsource' and 'program' out of the raw log data,
assuming that your raw logs are in syslog format.
I have made several long write-ups about how logstash operates. If you're interested in reading further about inputs and filters, please do see my below posts:
http://support.nagios.com/forum/viewtop ... 37&t=32221
http://support.nagios.com/forum/viewtop ... 68#p134768
Let me know if you have any questions along the way.
