All Apps and Add-ons

How to make splunk use dynamic data

vamsi92
Explorer

Hi,
I want splunk to continuously monitor a file, say some error log file.
and i will be writing a alert condition like if some error specific word is found in the error log, and will configure an action.
For now i am adding data through settings-> Add Data.
But the file is added into splunk is static, as even now if i change something in the original file it wont be knowing.
so i want splunk to monitor the file like an application created an error log on some location xyx. Splunk should run the scheduled alert by taking the latest copy of that error log from xyz location instead of the file i added to data.
Pls Indicate how to achieve this. And i am using splunk with Service-now(splunk addon for servicenow).
Also please specify is there any way to get data from service-now
thanks in advance.

0 Karma
1 Solution

renjith_nair
Legend

If you are using web to input your file, for continuously monitoring your file, just user the Monitor option and select the file or directory you want to monitor. Splunk will automatically monitor this file and forward event whenever there is an update.

The same can be done by configuring it in inputs.conf. Add a monitor stanza in your inputs.conf with file or directory location.

See here for more information :http://docs.splunk.com/Documentation/Splunk/6.1/Data/Editinputs.conf

In general : http://docs.splunk.com/Documentation/Splunk/6.1/Data/Monitorfilesanddirectories

For service now , check http://docs.splunk.com/Documentation/AddOns/latest/ServiceNow/ConfigureServiceNowtointegratewithSplu...

and also check the app https://splunkbase.splunk.com/app/1770/

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

chimell
Motivator

Hi vamsi92
You can use collect command to add data to an index which contain your originate data.
For example if you indexed data in an index called downloadcount you can make a search and put result into this index in a proportion as you make search .

Look at a search cde example using Collect command

Put "download" events into an index named "downloadcount".

eventtypetag="download" | collect index=downloadcount

For more information about collect command see the following link

http://docs.splunk.com/Documentation/Splunk/6.3.1/SearchReference/Collect

0 Karma

renjith_nair
Legend

If you are using web to input your file, for continuously monitoring your file, just user the Monitor option and select the file or directory you want to monitor. Splunk will automatically monitor this file and forward event whenever there is an update.

The same can be done by configuring it in inputs.conf. Add a monitor stanza in your inputs.conf with file or directory location.

See here for more information :http://docs.splunk.com/Documentation/Splunk/6.1/Data/Editinputs.conf

In general : http://docs.splunk.com/Documentation/Splunk/6.1/Data/Monitorfilesanddirectories

For service now , check http://docs.splunk.com/Documentation/AddOns/latest/ServiceNow/ConfigureServiceNowtointegratewithSplu...

and also check the app https://splunkbase.splunk.com/app/1770/

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...