icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading Python Cron Iteration for Splunk
SHA256 checksum (python-cron-iteration-for-splunk_110.tgz) aec912c1596f12716cfee54e0656b732b5cbfee7106eecf32517d15e380bc6aa SHA256 checksum (python-cron-iteration-for-splunk_105.tgz) 3fca8d9052fe6a75c4a70f9f1b45cc56fd5c3b90073acfc4ae6146b8f4506b59 SHA256 checksum (python-cron-iteration-for-splunk_104.tgz) 53a4f4823dd8f3571d3a5959918b269574e4aac41e798383073d81171b1ba2ea SHA256 checksum (python-cron-iteration-for-splunk_103.tgz) 5d8c1256ac4afc1cf85dbd6c6b780f4ef284b70263418e9b66f44424f4e13140 SHA256 checksum (python-cron-iteration-for-splunk_102.tgz) 5f800478c37031b24f2f31772c3cbcc501b34f84fa6dc479287fb5d87449b8b0 SHA256 checksum (python-cron-iteration-for-splunk_101.tgz) 2e29241874913f1b44f43098f72fc7a8d34969a345eac439160d4786272b2fd3 SHA256 checksum (python-cron-iteration-for-splunk_100.tgz) bde77a18d267234b5f6e54f15e64f48a72eaa083c2e80b908fe72c01550e1346
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Python Cron Iteration for Splunk

This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
The purpose of this command is to help visualize cron schedules and produce timestamps for expected runs based on the cron schedule. This was created largely to address the question, "How many searches are going to be running at timeblock X based on current search schedules?" While it may be used in other contexts, this command was built for that single purpose.

**Note**: There is a known issue whereby this app cannot be installed along side DBConnect 3.1.3. Install 3.1.4 or later.

Change Log

1.0

  • Initial Release

1.0.1

  • Confirmed compatibility with Splunk 7.2

1.0.2

  • Updated Croniter library to 0.3.27 (Previous version: 0.3.22)
  • Updated Splunk SDK to version 1.6.6 (Previous version: 1.6.2)
  • Removed explicit inclusion of six library. Splunk SDK now seems to include this.
  • Added option to specify an end epoch field instead of iteration count

1.0.3

  • Updated dateutil library
  • Confirmed compatibility with 7.3

1.0.4

  • Confirmed compatibility with 8.0 (python3 environment enabled globally)

1.0.5

  • Confirmed compat with 8.1
  • Upgraded Splunk SDK 1.6.14
  • Upgraded Croniter Library to 0.3.36
  • Upgrade dateutil Library to 2.8.1
  • Added natsort 7.0.1

1.1.0

  • Upgraded Splunk SDK
  • Upgraded Croniter library
  • Upgraded dateutil library
  • Upgraded natsort library
  • Confirmed Splunk 8.2 compatibility

Prerequisites

This search command is packaged with the following external libraries:
+ Splunk SDK for Python (http://dev.splunk.com/python)
+ Python Croniter Library (https://github.com/taichino/croniter)
+ Python dateutil Library (https://github.com/dateutil/dateutil)
+ Python six Library (https://pypi.org/project/six/)
+ Python natsort Library (https://github.com/SethMMorton/natsort)

Nothing further is required for this add-on to function.

Installation

Follow standard Splunk installation procedures to install this app.

Reference: https://docs.splunk.com/Documentation/AddOns/released/Overview/Singleserverinstall
Reference: https://docs.splunk.com/Documentation/AddOns/released/Overview/Distributedinstall

Description

The purpose of this command is to help visualize cron schedules and produce timestamps for expected runs based on the cron schedule. This was created largely to address the question, "How many searches are going to be running at timeblock X based on current search schedules?" While it may be used in other contexts, this command was built for that single purpose.

Usage

Command Type

  • Streaming

Command Usage

| croniter iterations=25 input=cron_schedule start_epoch=timestamp_field

Or

| croniter input=cron_schedule start_epoch=timestamp_field end_epoch=timestamp_field

Note that if both "iterations" and "end_epoch" are specified, the end_epoch will take precedence.

Sample Search

Starting now, show the next 25 expected runs for scheduled searches using a cron schedule and combine them to show which times have the highest number of searches scheduled.

| rest /servicesNS/-/-/saved/searches splunk_server=local
| where disabled=0 and is_scheduled=1
| table cron_schedule,title,disabled,is_scheduled
| croniter iterations=25 input=cron_schedule
| stats values(title) as searches,dc(title) as dc_searches by croniter_return
| convert ctime(croniter_return) timeformat="%Y-%m-%d %H:%M:%S"
| sort 0 - dc_searches

Same as the previous except start the iterations at a timestamp 2 days previous:

| rest /servicesNS/-/-/saved/searches splunk_server=local
| where disabled=0 and is_scheduled=1
| table cron_schedule,title,disabled,is_scheduled
| eval start_epoch=relative_time(now(),"-2d@d")
| croniter iterations=5 input=cron_schedule start_epoch=start_epoch
| stats values(title) as searches,dc(title) as dc_searches by croniter_return
| convert ctime(croniter_return) timeformat="%Y-%m-%d %H:%M:%S"
| sort 0 - dc_searches

Search using an end epoch instead of iteration count as the marker for stopping the generation:

| rest /servicesNS/-/-/saved/searches splunk_server=local
| where disabled=0 and is_scheduled=1
| table cron_schedule,title,disabled,is_scheduled
| eval myendepoch=relative_time(now(),"+3d@d")
| croniter end_epoch=myendepoch input=cron_schedule

Support

If support is required or you would like to contribute to this project, please reference: https://gitlab.com/johnfromthefuture/TA-croniter. This app is supported by the developer as time allows.

Release Notes

Version 1.1.0
March 1, 2022

1.1.0

  • Upgraded Splunk SDK
  • Upgraded Croniter library
  • Upgraded dateutil library
  • Upgraded natsort library
  • Confirmed Splunk 8.2 compatibility
Version 1.0.5
Nov. 13, 2020

1.0.5

  • Confirmed compat with 8.1
  • Upgraded Splunk SDK to version 1.6.14
  • Upgraded Croniter Library to version 0.3.36
  • Upgrade dateutil Library to version 2.8.1
  • Added library natsort 7.0.1
Version 1.0.4
Jan. 17, 2020

1.0.4
Confirmed compatibility with Splunk 8/py3

Version 1.0.3
Aug. 1, 2019

1.0.3

  • Updated dateutil library
  • Confirmed compatibility with 7.3
Version 1.0.2
Feb. 14, 2019

1.0.2

  • Updated Croniter library to 0.3.27 (Previous version: 0.3.22)
  • Updated Splunk SDK to version 1.6.6 (Previous version: 1.6.2)
  • Removed explicit inclusion of six library. Splunk SDK now seems to include this.
  • Added option to specify an end epoch field instead of iteration count (Thanks to user @gjanders for submitting this idea!)
Version 1.0.1
Oct. 22, 2018
Version 1.0.0
May 30, 2018

Initial release.


Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.