- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
02-01-2024 05:48 AM
Hello,
XQL beginner here, after 1 hour of tryhard with the cheap xql palo alto documentation. Finally got what I want but I feel like I've done it the wrong wa
Context
Target
Example
Desired output
File | Hits |
test.txt | 2 |
also_test.txt | 1 |
My take
dataset = alerts
| filter rule_id = "whatever"
| fields file_name
| alter file = arraystring(arraydistinct(file_name),",")
| comp count(file_name) as hits by file
Any suggestions ?
02-01-2024 06:05 AM
I hope i got the use correctly, and based on my understadning, you may try the below query
dataset = alerts
| fields rule_id , file_name , file_sha256
| arrayexpand file_name
| comp count(file_name ) as Hits by file_name
| sort desc Hits
Sample output should look like the below
You may also add more fields, and filters as you wish if you need so!
If this answers your question feel free to mark it as a solution so other can benefit from!
Thanks
Z
02-01-2024 06:05 AM
I hope i got the use correctly, and based on my understadning, you may try the below query
dataset = alerts
| fields rule_id , file_name , file_sha256
| arrayexpand file_name
| comp count(file_name ) as Hits by file_name
| sort desc Hits
Sample output should look like the below
You may also add more fields, and filters as you wish if you need so!
If this answers your question feel free to mark it as a solution so other can benefit from!
Thanks
Z
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!