Hi everyone,
I’m working on building native dashboards in Google SecOps and need to create a specific visualization. I have an SQL query that provides the required data, but I’m unsure how to achieve the same result using a YARA-L query in Google SecOps.
Pseudo SQL Query:
WITH user_table AS (
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT user)) AS users
FROM events
GROUP BY id, destination_ip
)
SELECT AVG(STRING_LENGTH(users)) FROM user_table;For example, my dataset looks like this:
| id | destination_ip | user |
| 1 | dest_ip_1 | user_1 |
| 2 | dest_ip_2 | user_2 |
| 1 | dest_ip_1 | user_3 |
| 2 | dest_ip_2 | user_4 |
After executing with clause SQL query, I get the following transformed table:
| id | destination_ip | users |
| 1 | dest_ip_1 | user_1, user_3 |
| 2 | dest_ip_2 | user_2, user_4 |
Next, the original query calculates the average length of the users field.
Calculation:
result = (length(user_1,user_3) + length(user_2,user_4)) / 2
= (13+13) / 2
= 13Is there a way to achieve this in a Google SecOps native dashboard using a YARA-L query?
Any suggestions or reference documentation would be greatly appreciated.
Thanks,
Prashant Nakum



