Splunk SOAR

Getting containers from Jan to March using REST API

JoshiSri
Explorer

Hi there, 

 

I am trying to get the containers detials for stipulated time period, Lets say, Jan 1st 2023 - March 31st - 2023. 

May I know what is the format here to get it from REST API. I am trying using below query  and getting the results from the very latest conatiners as well. 

 

https://phantom.example.com/rest/container?sort=id&order=desc&label='phishing'&page_size=40000&"star...

 

Sample output: sharing only one key: value pair

"start_time": "2023-04-19T07:36:41.728895Z",
0 Karma
1 Solution

phanTom
SplunkTrust
SplunkTrust

This is the best one from a fellow trust member:

https://github.com/zamastyle/phantom_mhike/blob/main/Rest%20API%20Cheat%20Sheet.md 

Feel free to mark as a solution to help others with similar issues/queries

-- Hope this helps, if so consider leaving some Karma. Even better is if this fixed your issue, that you mark as a solution for others to find. Happy SOARing!! ---

View solution in original post

phanTom
SplunkTrust
SplunkTrust

This is the best one from a fellow trust member:

https://github.com/zamastyle/phantom_mhike/blob/main/Rest%20API%20Cheat%20Sheet.md 

Feel free to mark as a solution to help others with similar issues/queries

-- Hope this helps, if so consider leaving some Karma. Even better is if this fixed your issue, that you mark as a solution for others to find. Happy SOARing!! ---

phanTom
SplunkTrust
SplunkTrust

@JoshiSri you need to add `_filter_<field>` to your query. 

Also I am not sure about the page size but if you set it to 0 then you get all. 

-- Hope this helps, if so consider leaving some Karma. Even better is if this fixed your issue, that you mark as a solution for others to find. Happy SOARing!! ---

JoshiSri
Explorer

Superb..!! Again, on the mark. Is there any doc for these kind of parameters? 

 

The one on the phantom doc is very on the higher level and is of no use if you want to drill down your search. 

 

It helps, thanks a lot. 

0 Karma

JoshiSri
Explorer

Awesome, worked like charm..!! 

One last  query, is there any limit for "page_size=40000" and "label='phishing'" this condition, is not working at all, is there a different way to parse label as phishing only containers? 

 

Thanks again, for your quick response. 

0 Karma

phanTom
SplunkTrust
SplunkTrust

@JoshiSri you need to use the lte/gte conditions in the REST call:

e.g.

/rest/container?_filter_start_time__gte="2023-01-01T00:00:00"&_filter_start_time__lte="2023-03-01T00:00:00"

Note the double "_" for the lte/gte 

You can use python to create the date/time strings if you need to do this dynamically. 

-- If this helped please mark as the solution. Happy SOARing --

-- Hope this helps, if so consider leaving some Karma. Even better is if this fixed your issue, that you mark as a solution for others to find. Happy SOARing!! ---
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Casting Call: Compete in Cyber Games

Lights, Camera, SecOps: Apply to Compete in Cyber Games     Think you have what it takes to beat the clock? ...

Data Management Digest – June 2026

Welcome to the June 2026 edition of Data Management Digest! This month’s update is short and sweet, with a ...

Think Like an Architect: Introducing the Splunk Certified Cybersecurity Defense ...

In cybersecurity, defenders respond to threats. Architects design the systems that stop them.    As ...