Skip to main content
Version: 1.0.0

s3splquery

The command s3splquery queries files in S3 using S3Select with a query saved in S3SPL. The usage of saved queries allows sharing of queries with other users and allows for access restrictions on a per-query basis.

Arguments

argumentrequiredformatdescription
bucketyesstringbucket used by the query
query_nameyesstringname of the query to run
replacementsnostringkv-pairs used to replace tokens in query
threadsnointnumber of threads used to query S3
max_resultsnointthe maximal count of events fetched from S3, defaults to unlimited

All other fields are taken from the stored query. In case of replacements, the KV-pairs are merged. The user-provided input takes precedence if there is a definition for a key in the user's input and the saved arguments.

Examples

Query S3 bucket firewall-archive with time constraints set using the searches timerange picker and prefix. The query will check the field timestamp for the time constraints in addition to the time constraints set in the prefix.

Default FieldDefault Value
query*
timestamp_fieldtimestamp
timestamp_usedfalse
replacements
| s3spladhoc 
bucket="firewall-archive"
query_name="firewall-logs"
replacements=""

Query S3 bucket firewall-archive with time constraints set using the searches timerange picker and prefix. The query only checks the time constraints set in the prefix. The field timestamp is still required for telling Splunk the time of the events.

Default FieldDefault Value
query*
timestamp_fieldtimestamp
timestamp_usedfalse
replacements
| s3spladhoc 
bucket="firewall-archive"
query_name="firewall-logs"
replacements=""

Query S3 bucket firewall-archive with host and the _raw field named dvc and event respectively.

Default FieldDefault Value
query*
timestamp_fieldtimestamp
timestamp_usedfalse
replacements
host_fielddvc
raw_fieldevent
| s3spladhoc 
bucket="firewall-archive"
query_name="firewall-logs"
replacements=""

Query S3 bucket firewall-archive with host and the _raw field named dvc and event respectively. The query will only return the fields dvc and event.

Default FieldDefault Value
query*
timestamp_fieldtimestamp
timestamp_usedfalse
replacements
host_fielddvc
raw_fieldevent
fieldsdvc,event
| s3spladhoc 
bucket="firewall-archive"
query_name="firewall-logs"
replacements=""

Query S3 bucket firewall-archive with setting dvc using a token replacement.

Default FieldDefault Value
querydvc=$dvc$
timestamp_fieldtimestamp
timestamp_usedfalse
replacements
host_fielddvc
raw_fieldevent
fieldsdvc,event
| s3spladhoc 
bucket="firewall-archive"
query_name="firewall-logs"
replacements="dvc=firewall-1""

Permissions

Each query has roles with read and / or write permissions assigned. The user executing a query needs to have read permissions for the query and execution permissions for the command. Execution permission is provided by the role s3spl_user.