Bringing data into Splunk
Now, lets dive deep into bringing data into Splunk.
- Splunk Enterprise can index any type of data, however it works best with data with timestamps.
- When Splunk indexes data, it breaks it into events based on timestamps.
- Every event or data which is indexed into Splunk should have a sourcetype ( helps to identify the type of data which is indexed ) assigned to it.
- In corporate environment, majorly forwarders (ref: here) are used to input data into Splunk but there are other ways as well in which you can get your data indexed to Splunk.
Lets assume you want to monitor a log file of the local machine on which Splunk is installed then you can use the hyperlinks which are listed under "Local inputs" otherwise you can use the hyperlinks which are listed under "Forwarded inputs".
For achieving that, you can navigate to "Settings" => "Data Inputs" => "Local Inputs" => "Add New" (NOTE: Make sure Splunk have access to the log files which you are trying to monitor under Splunk).
Enter the log file which you want to monitor, also select the type of monitoring which you want to achieve i.e. you just want to index the logfile once? or you want to continuously monitor mentioned log file (Just to add, this works as tail in linux as soon as there is something in log file it will index that part). Once done click on "Next".
Amazingly :), Splunk automatically divide the data into small chunks of data called events that too without any human intervention. Clink on "Next".
Select the app context, as of now we are going with "Search and Reporting", give a meaningful host name, select the index in which you want the data to be indexed. Since I already have a index called idx_messages I will choose that otherwise you can create one as per your need as well. Click on "Review".
On the final screen, if you feel everything is fine, Click on "Submit", your data is now being indexed.
Go ahead and verify via search head if your data came in or not ;)
Another thing to add, there are multiple types of source_types available in Splunk just to give you a hint below are some of them:
Comments
Post a Comment