cypresspoint package¶
Submodules¶
cypresspoint.checkpoint module¶
Simple checkpoint tracking helper class with dictionary-like access. This is used for modular inputs to track their state between executions.
- class cypresspoint.checkpoint.ModInputCheckpoint(checkpoint_dir, input_name)[source]¶
Bases:
object
- NotSet = <object object>¶
cypresspoint.compat module¶
A collection of Python 2/3 compatibility functions.
This is kept for backwards compatibility, but this should eventually be depreciated and removed.
cypresspoint.datatype module¶
- cypresspoint.datatype.as_bool(s)[source]¶
Convert a boolean-like configuration field into a proper boolean.
- Parameters:
s (str) – Input string containing some form of truthy value
- Return type:
bool
- cypresspoint.datatype.reltime_to_timedelta(value: str) timedelta [source]¶
Convert a relative time expression into a Python timedelta object. Only a subset of Splunk’s relative time syntax is supported, but many simple expressions like
7d
(7 days),5m
(5 mins),6mon
(6 months), and2y
(2 years) should just work.This does not support snapping with
@
. At this time relative times addition (+
) or subtraction (-
) is not yet supported, but should be.- Parameters:
value (str) – Relative time expression
- Returns:
python object representation of the given relative time
- Return type:
timedelta
cypresspoint.modinput module¶
- class cypresspoint.modinput.ScriptWithSimpleSecret(*args, **kwargs)[source]¶
Bases:
Script
Class that extends Splunk’s default ‘Script’ that allows for very basic storage of a secret value. Note that this technically results in a race-condition where the unencrypted secret is exposed for some short period of time. Therefore this shouldn’t be used in high security scenarios or on servers with many snooping users, but for private use apps on a dedicated data onboarding forwarder, this approach is often “good enough”.
- handle_secret(input_name: str, password: str, app: Optional[str] = None) str [source]¶
Get, Set, or Update secret field as needed.
This command will encrypt any clear-text password and mask it’s value in
inputs.conf
. If a clear-text password is not given, then it’s assumed to have been previously saved and will be loaded frompasswords.conf
- Parameters:
input_name (str) – Stanza in
inputs.conf
of the modular inputpassword (str) – The recipient of the message
app (str or None) – The splunk app namespace to use for REST interactions against inputs and password endpoints
- Returns:
the clear-text password
- Return type:
str
- secret_field = 'secret'¶
cypresspoint.monkeypatch module¶
Hot in-place fixes for splunklib (Splunk’s Python SDK)
NOTE: Simply importing this module will activate the monkeypatch.
cypresspoint.searchcommand module¶
Helper functions for custom Splunk Search Commands
cypresspoint.spath module¶
Module contents¶
Top-level package for Cypress Point.