Skip to main content

If else then

  • October 11, 2024
  • 2 replies
  • 38 views

Omskirt
Forum|alt.badge.img+7

Can we use if else then in outcome section in Native dashboard like working the hours. I’m getting on this. 

if (timestamp.get_hour($timestamp, "UTC") >= 1 and timestamp.get_hour($timestamp, "UTC") < 17, 50)

 

2 replies

AymanC
Forum|alt.badge.img+14
  • Bronze 5
  • October 11, 2024

Hi @Omskirt,

Does the below search provide a proof-of-concept of what you need In the below example image I've modified the '1' for the first 'timestamp.get_hour' to '5', just for demonstration purposes.

 

 

metadata.log_type = "AWS_CLOUDTRAIL" metadata.event_timestamp.seconds = $timestamp metadata.id = $EventID (timestamp.get_hour($timestamp, "UTC") >= 1 and timestamp.get_hour($timestamp, "UTC") < 17) match: $EventID outcome: $EventTimestamp = array_distinct(timestamp.get_timestamp($timestamp, "%F %T", "UTC")) $GetRiskScore = max(0 + if(timestamp.get_hour($timestamp, "UTC") >= 1 and timestamp.get_hour($timestamp, "UTC") < 17, 50, 0))

 

Kind Regards,

Ayman C


Omskirt
Forum|alt.badge.img+7
  • Author
  • Bronze 2
  • October 11, 2024

Oww, I see I need to declare the timestamp in outcome sections I always thought in could be in outcome only. I understand now. Thank you so much