Splunk SOAR (f.k.a. Phantom)

Deleting Custom List Items

CS_
Path Finder

In a playbook, I have a decision tree.

If option A -> Check List -> If Value Exists in custom list -> Do Nothing

Else If Option b -> Check list -> If Value Exists in custom list -> Delete that list entry.

Checking in the SOAR Phantom app actions, I see several options for lists, but no option to "remove/delete listitem" (see attached pic)


How do I go about deleting items from a Custom List?

Thanks!

(SOAR Cloud 5.3.1)

 

 

Labels (2)
0 Karma
1 Solution

phanTom
SplunkTrust
SplunkTrust

@CS_ 

There is an API to perform this in a code block or custom function:

https://docs.splunk.com/Documentation/SOAR/current/PlaybookAPI/DataManagementAPI#delete_from_list 

Otherwise you can rebuild the list without the value(s) and then use set_list to overwrite: 

 https://docs.splunk.com/Documentation/SOAR/current/PlaybookAPI/DataManagementAPI#set_list 

View solution in original post

0 Karma

phanTom
SplunkTrust
SplunkTrust

@CS_ 

There is an API to perform this in a code block or custom function:

https://docs.splunk.com/Documentation/SOAR/current/PlaybookAPI/DataManagementAPI#delete_from_list 

Otherwise you can rebuild the list without the value(s) and then use set_list to overwrite: 

 https://docs.splunk.com/Documentation/SOAR/current/PlaybookAPI/DataManagementAPI#set_list 

0 Karma

CS_
Path Finder

@phanTomAs always, you've dropped the perfect answer. Many thanks!

I'll give this a try (from the first URL you provided)

phantom.delete_from_list(list_name=None, value=None, column=None, remove_all=False, remove_row=False)

 

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...