Hi all,
I'm trying to create a new input for our created RestAPI-Call.
As this call should only be executed once in a month (ticket-data) I struggle with the only available Interval-Option which is seconds and not crontab-format.
I further discovered that when setting interval in seconds having splunk restarted the counter of seconds starts from that point in time somehow that messes with a predicted input interval.
Question: Is it possible to use cron-entry in underlaying input.conf file in created AoB-App?
Thanks for any feedback
Lothar
You can always just modify the inputs.conf interval entry to a cron setting.
For example for At 00:00 on day-of-month 1.
interval=0 0 1 * *
Thanks for your feedback.
Why does AoB then only provide seconds for the interval option and errors when trying to configure cron-formatted string?
Anybody able to put some light on this?
Lothar
You could use checkpoints in order to not mess to much with time intervals. I've implemented something before that calls a REST API and saves the last data point date as a checkpoint and the next time I call it I just use the checkpoint as a starting date. In the add-on python logic you can use anything, in your case that could ticket id, ticket last update time, etc. There are helper functions that already help you accomplish this. This method also allows you to have more recent data to work with.
Some links that might be helpful:
https://docs.splunk.com/Documentation/Splunk/8.2.6/AdvancedDev/ModInputsCheckpoint
https://docs.splunk.com/Documentation/AddonBuilder/4.1.0/UserGuide/PythonHelperFunctions
If you still want to go via the cron route there are some python libs (e.g. http://pypi.python.org/pypi/croniter/) that can convert cron into date time
Thanks for your hints; actually we do not use python-scripts (only Rest-Call).
As the Rest-API itself provides ability to define timerange to report on we simple need a defined schedule to perform the call.
Interval in seconds is not that best vehicle as by restarting splunk count starts at timepoint of restart.
To undstand you correct, cron-timing is not available/possible with AoB?
Or can I simply edit inputs.conf?
Lothar
As far as I know its just seconds. Also, looking into the docs on configuring inputs it just states seconds.
https://docs.splunk.com/Documentation/AddonBuilder/4.1.0/UserGuide/Usetheaddon