Monitoring Splunk

How to monitor my script output file automatically every one hour

prathapkcsc
Explorer

I have a script containing ip and value.
Sh basic.sh>>sample.out
Know to get the logs i need to add this sample.out file to splunk like
/opt/splunkforwarder/bin/splunk add monitor sample.out.
Then i the files will comes into splunk..
But the problem is i want that script to be run everyone one hour..everytime adding that output file to splunk is not a good idea..Is there any way to schedule automatically or monitor that output file all the time...

i want to avoid the below step everytime
"/opt/splunkforwarder/bin/splunk add monitor filename"

can i add it to this folder
monitor://$SPLUNK_HOME/var/log/splunk]

Thank you!

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If the script always writes to the same file you only need to add the monitor once. Splunk will then periodically check the file for changes and automatically index them.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If the script always writes to the same file you only need to add the monitor once. Splunk will then periodically check the file for changes and automatically index them.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...