Bringing data into Splunk (Continued...)
What happened behind the hood?
When we added the new log file to be monitored via the graphical interface, it created and added a configuration item into inputs.conf configuration file.
You can find the configuration file here:
When we added the new log file to be monitored via the graphical interface, it created and added a configuration item into inputs.conf configuration file.
You can find the configuration file here:
- $SPLUNK_HOME/etc/apps/search/local/inputs.conf
- You can also manually edit this file and add your custom stanza, once done to notify Splunk about the changes, the daemon needs to be restarted.
- It will contain something like this:
[monitor:///var/log/messages]
disabled = false
host = splunk_server
index = idx_messages
sourcetype = linux_logs
Above block is known as stanza, lets decipher this :)
- monitor: This is used to specify which logfile(s) you want to monitor i.e. you can mention a specific logfile as well as full directory lets say you want to monitor everything under /var/log directory, just mention "monitor:///var/log/" and Splunk will try to index everything which is there in that directory.
- disabled: Lets say you want to disable a monitor temporarily then you can mention true instead of false.
- host: A meaningful hostname, so that people can easily understand from where the events are coming in.
- index: Name of the index in which you want your data to be indexed.
- sourcetype: Type of data which is being indexed.
Note: When Splunk monitors the data, initially it index everything which it finds then it maintains a record of where it last read the data from so that if incase there is new data then it can index that as well.
Comments
Post a Comment