Knowledge Management

How to filter a field with multiple values for a key via


I am able to fetch data using filter as query=json.dumps({'status': 'Fixed'})
But, am not able to filter data for multiple values.
Its either giving data for only one of the two values or not giving data at all or giving some kind of an error.
I want to do something like query=json.dumps({'status': ['Fixed', 'New']})


import json
import splunklib.client as client
service = client.connect(
host='xxxx', port=xxxx, username='xxxx', password='xxxxx', owner='xxxxx', app='xxxx')
collection = service.kvstore['xxxx']
response =********) --> pass a query here

0 Karma


You can use the "$or" or "$and" operator in your json query, here is an example that worked for me:

query = json.dumps({"$or":[{"id": "X354" },{"id":"Y762"}]})
data = =query) 

Ressources :

0 Karma
Get Updates on the Splunk Community!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...