- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
11-15-2023 09:43 AM
Hi,
I hope you can shed some light. I am attempting to run a query to find out what system is running what applications including the username.
I have this query which gives me what I need except the "user" which is a field in another dataset xdr_data. How can add this new dataset to get the "user" field? Thank you
config case_sensitive = false
| dataset = host_inventory
| fields host_name, applications
| arrayexpand applications | alter readable_application_name = json_extract(applications, "$.application_name")
| fields readable_application_name, host_name
11-16-2023 03:02 AM
Hi @RiveraMarco
You may try this and edit this query based on your requirements:
config case_sensitive = false
| dataset = host_inventory
| fields host_name, applications
| arrayexpand applications
| alter readable_application_name = json_extract(applications, "$.application_name")
| alter app_name = trim (readable_application_name ,"\"")
| fields app_name
| join type = inner (dataset= xdr_data | fields actor_process_image_name , os_actor_process_image_name , action_file_name , actor_primary_username , causality_actor_process_image_name ) as aip aip.actor_process_image_name contains app_name
| filter (actor_primary_username != """NT AUTHORITY\\SYSTEM""")
| dedup app_name , actor_primary_username , actor_process_image_name
Feel free to write back if you have further query.
Hope this helps!
Please mark the response as "Accept as Solution" if it answers your query.
11-15-2023 09:47 AM
Hi @RiveraMarco , thanks for reaching us using the Live Community.
You can call two datasets using the "in" operator.
Example:
dataset in (xdr_data, panw_ngfw_traffic_raw )
11-15-2023 09:56 AM
So how to add the user field from xdr_data into my query? Thanks for your help
config case_sensitive = false
| dataset in (host_inventory, xdr_data)
| fields host_name, applications
| arrayexpand applications | alter readable_application_name = json_extract(applications, "$.application_name")
| fields readable_application_name, host_name
11-15-2023 09:59 AM
So how to add the user field from xdr_data into my query? Thanks for your help
config case_sensitive = false
| dataset in (host_inventory, xdr_data)
| fields host_name, applications
| arrayexpand applications | alter readable_application_name = json_extract(applications, "$.application_name")
| fields readable_application_name, host_name
11-16-2023 03:02 AM
Hi @RiveraMarco
You may try this and edit this query based on your requirements:
config case_sensitive = false
| dataset = host_inventory
| fields host_name, applications
| arrayexpand applications
| alter readable_application_name = json_extract(applications, "$.application_name")
| alter app_name = trim (readable_application_name ,"\"")
| fields app_name
| join type = inner (dataset= xdr_data | fields actor_process_image_name , os_actor_process_image_name , action_file_name , actor_primary_username , causality_actor_process_image_name ) as aip aip.actor_process_image_name contains app_name
| filter (actor_primary_username != """NT AUTHORITY\\SYSTEM""")
| dedup app_name , actor_primary_username , actor_process_image_name
Feel free to write back if you have further query.
Hope this helps!
Please mark the response as "Accept as Solution" if it answers your query.
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!