Skip to main content

A helper for Splunk-related development, maintenance, or migration operations.

Project description

Splunk Management Utility

🤝 Show your support - give a ⭐️ if you liked the tool | Share on | Follow us on


License: GPL v3


This library is an abstraction for Splunk-related development, maintenance, or migration operations. It provides a single CLI or SDK to conveniently perform various operations such as managing a local development container, retrieving sample-data, building applications, comparing instances, managing knowledge objects and hopefully much more in the future.

Motivation 🔥

When I work with Splunk, my working directory is usually in the same layout. I work with a mono-repository or a higher-level one with submodules, which contains several applications and configuration. This can look generalized like this:

<Development Repository>
├── apps                          # Folder where to store applications
│   └── Defender_TA_nxtp          # Generic custom Splunk app
├── dist                          # Place for built packages and reports
├── scripts
├── config                        # Settings and secrets
│   └── settings.yaml             # General purpose settings for this lib
│   └── .secrets.yaml             # API settings for connections and secrets
└── share                         # Custom splunkbase or builtin app content

We have all found our ways and methods to develop applications on an instance and to configure and operate that instance to meet our needs and/or those of our customers. But what is usually rather painful is when we then need them on other instances as well. A good example are test instances, which should be as close to production as possible. However, in the last few years that I have been dealing as a user with Splunk, some needs for simplified handling and automation have emerged that I would like to address here.

We want to ...

  • Spin up a local development container:

    spl docker start
    
  • Put my local application(s) there for testing purposes:

    spl docker upload --app="Defender*"
    
  • Get sample data for Eventgen:

    spl --src="onprem"  samples --path="./apps/SA-Eventgen" download --name="WinDefender"
    
  • (De)activate streaming of event data.

  • Download apps from development container to local folder:

    spl docker download --app="Defender*"
    
  • Run AppInspect, Packaging, etc.:

    spl apps --name="Defender_TA*" validate
    
  • List various objects on an instance:

    spl manager --conn="onprem" users list
    
  • Create or modify objects on an instance:

    spl manager --conn="onprem" roles update --name "investigator"
    
  • Sync objects and their properties from one instance to another:

    spl --src="onprem" --dest="localhost" sync users --create --update
    

and probably much more, so pull requests are welcome!

Getting Started 🚀

You can download the package from the package feed via pip install spl-manager or install from source with poetry after cloning the repository.

Then you can issue your first command to get the help page:

python -m spl -h

or poetry run python -m spl -h. Anyhow it's recommended to set the alias spl="python -m spl for easier handling.

You have to create a config\.secrets.yaml file by using the config\template.secrets.yaml file, which contains the credentials for the Development Docker-Container and Splunkbase.

Using the library 📚

Please note that, when using the library as an SDK you need to pass the interactive=False flag to not run into issues because in interactive mode it asks for user inputs via CLI methods.

from spl import SplManager

spl = SplManager(interactive=False)

Using the CLI 🧑‍💻

If you wish to get more information about any command within spl, you can pass the -h parameter.

Top-level spl Options

  • --interactive: Wether or not to run in interactive mode.
  • --src: The name of the source connection provided in settings.
  • --dest: The name of the destination connection provided in settings.

Top-level spl Modules

  • connections provides you a list of connections available via configuration.

  • docker helps you to manage the local splunk container instance.

  • apps abstracts the handling of local application folders at a given --path and helps with validation, packaging, vetting, etc.

  • samples are based on the configured queries for a --conn or --src and can download results and store them automatically at a --path to use for SA-Eventgen.

  • manager acts as a direct ConnectionAdapter interface for the specified --conn parameter.

  • sync will handle managers for --src and --dest connections, enabling you to compare, move and update between those instances.

🔗 References

🤩 Support

Support via PayPal or send us some crypto:

Protocol Address
Ethereum 0xcFC6Bdb68FB219de754D01BcD34F8A339549C910
Avalanche X-avax1vlrw8m9af5p4kx2zxc4d5lqmgh8c86uduwprg6
Harmony one18fcze47fll6662ggr760u9jm3rfz859jkv7vyw
Binance Chain bnb1q6zg3pnmclnfhy6vtldfd0az97l0ndayun2tzn
Binance Smart Chain 0x1CD0ca3eC911Fe9661905Dd500FBaCE245c7013f
Solana Eh35fdT6gdMHcsj3TrTMnNDSgvWAEMc11Zhz9R96F7aB

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spl-manager-0.1.1.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

spl_manager-0.1.1-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file spl-manager-0.1.1.tar.gz.

File metadata

  • Download URL: spl-manager-0.1.1.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.7.12 Linux/5.11.0-1028-azure

File hashes

Hashes for spl-manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0d7441c01f7b25c405d43713a29ca33df75fb199cd9807078fcbeb5d2890c81b
MD5 7e4692d04b346b2103b3cc361ffc3ce6
BLAKE2b-256 12b6ed90a0a1b68f0f849c3f73fd35347a61164b68480fd6a269abff9e83c868

See more details on using hashes here.

File details

Details for the file spl_manager-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spl_manager-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.7.12 Linux/5.11.0-1028-azure

File hashes

Hashes for spl_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3195a213636897c697c1fed6c31eff1b062e4fbff4436a4838cc5d894603e5ec
MD5 5170ac142542463243c534b03260ee31
BLAKE2b-256 aeca1f82dde33b781b83095573c26e27ca6d818ed2b9df2b5ec8091dbd914673

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page