Skip to main content

stats command not returning results

  • October 23, 2024
  • 3 replies
  • 9 views

rahul7514
Forum|alt.badge.img+10

Hi

I am trying to run a stats command to know the name of alerts triggered under product name "

"Office 365 Security and Compliance" for last 15 days 

 but its not giving any results , what am i doing wrong here ?

 


Query 

 

$product_name = $e.metadata.product_name $product_name = "Office 365 Security and Compliance" $alert_name = $e.security_result.rule_name match: $alert_name outcome: $count = count($e.metadata.id) order: $alert_name asc limit: 10

 

 

3 replies

jstoner
Staff
Forum|alt.badge.img+22
  • Staff
  • October 23, 2024

Your syntax is fine, I'd start with troubleshooting the fields you are using in the search, specifically the metadata.product_name and security_result.rule_name and ensure those are the proper fields and values. My O365 data does not include that product name so I can't validate that and searching O365 with re2 gave me no values in that alert field but an event count of all values, so I know your search at the syntax level works.


rahul7514
Forum|alt.badge.img+10
  • Author
  • Bronze 2
  • October 24, 2024

Your syntax is fine, I'd start with troubleshooting the fields you are using in the search, specifically the metadata.product_name and security_result.rule_name and ensure those are the proper fields and values. My O365 data does not include that product name so I can't validate that and searching O365 with re2 gave me no values in that alert field but an event count of all values, so I know your search at the syntax level works.


@jstoner : Yeah those 2 fields exists, i verified again ,Sharing screenshot for confirmation 

 


jstoner
Staff
Forum|alt.badge.img+22
  • Staff
  • October 24, 2024

 Thanks for the samples. The issue appears to be that the UDM field needs to be tied to the value you are filtering on and not a placeholder variable. If you look at my example below, I have the product name tied to the GCP firewall data and then since I am using a placeholder variable, I am also tying that to the field.  

 

$e.metadata.product_name = "GCP Firewall"
$product_name = $e.metadata.product_name
//$product_name = "Office 365 Security and Compliance"
$alert_name = $e.security_result.rule_name
match:
$alert_name
outcome:
$count = count($e.metadata.id)
order:
$alert_name asc
limit:
10