Available operator values for Alerts API Filter?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Available operator values for Alerts API Filter?

L0 Member

I'd like to submit an Alerts API request as documented here
https://pan.dev/prisma-cloud/api/cspm/submit-an-alert-csv-download-job/
but I'd like to filter it by just certain cloud.accountId values.  
The filters documentation at https://pan.dev/prisma-cloud/api/cspm/get-alert-filter-and-options/ list the fields available to filter on but  there is no list of supported operators other that "=" and there doesn't seem to be any general API documentation of supported operators either.
I've tried "operator": "IN" and "operator": "in" and "operator": "contains"  followed by "value": "('accountA', accountB', 'account')"   to no avail.  
Is this possible or is "=" the only operator supported in Alerts Filters? 

1 accepted solution

Accepted Solutions

L1 Bithead
Hello,

The documentation does state that '=' is a valid operator to use.  We would have to look into whether or not alternative operators would work with the API call used to Submit Alert CSV Generation Job.  Can you please try passing the following in the body of your request?  Please insert valid account ids and other aspects of the body as needed.


{
"filters": [
{
"name": "cloud.accountId",
"operator": "=",
"value": "123"
},
{
"name": "cloud.accountId",
"operator": "=",
"value": "1234"
},
{
"name": "cloud.accountId",
"operator": "=",
"value": "12345"
}
],


Please confirm if this works for you.

View solution in original post

2 REPLIES 2

L1 Bithead
Hello,

The documentation does state that '=' is a valid operator to use.  We would have to look into whether or not alternative operators would work with the API call used to Submit Alert CSV Generation Job.  Can you please try passing the following in the body of your request?  Please insert valid account ids and other aspects of the body as needed.


{
"filters": [
{
"name": "cloud.accountId",
"operator": "=",
"value": "123"
},
{
"name": "cloud.accountId",
"operator": "=",
"value": "1234"
},
{
"name": "cloud.accountId",
"operator": "=",
"value": "12345"
}
],


Please confirm if this works for you.

Thanks so much for the help!  It's ugly, as I have a large number of cloud.accountIds I need to filter on,  but it works!  

  • 1 accepted solution
  • 678 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!