- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-29-2019 08:11 AM - last edited on 09-02-2020 11:09 AM by CHopson
Hello,
I have an error when we are implementing a RQL query in the Investigate tab.
We make a join query searching in a VMs list and a NICs list in the prisma platform over a Azure suscription.
The problem seems to be over the filter part when we use the ['xxx.xxx'] format in a query when an atribute have a dot inside, because when we change to other atribute that don't have dot, it runs.
The query is the next (we are checking the atributes to correlate the VMs):
config where api.name = 'azure-network-nic-list' as X; config where api.name = 'azure-vm-list' as Y; filter '$.X.['properties.virtualMachine'].id == $.Y.['properties.networkProfile'].networkInterfaces[*].id and $.X.tags.owner exists'; show X;
Do anyone know if the definition over the filter could be different that in the filter body? Is it any separating character that allow the query? Could be a bug in the prisma platform?
Regards.
10-29-2019 09:22 AM
Try this RQL ( with double quotes for filter):
config where api.name = 'azure-network-nic-list' as X; config where api.name = 'azure-vm-list' as Y; filter "$.['X'].['properties.virtualMachine'].['id'] == $.['Y'].['properties.networkProfile'].networkInterfaces[*].['id'] and $.X.tags.owner exists"; show X;
11-21-2019 07:43 PM
VRuiz,
Please try the below RQL.
config where cloud.account = 'Azure-Redlock-public-demo' AND api.name = 'azure-network-nic-list' as X; config where api.name = 'azure-vm-list' as Y; filter "$.['X'].['properties.virtualMachine'].id contains $.['Y'].['properties.osProfile'].computerName and $.X.tags.owner exists"; show X;
The issue you were running into is that $.['Y'].['properties.networkProfile'].networkInterfaces[*].id references the network interface Id, but that value doesn't exist in the nic-list response. So what you need to do is map from the NIC to the Computername.
10-29-2019 09:22 AM
Try this RQL ( with double quotes for filter):
config where api.name = 'azure-network-nic-list' as X; config where api.name = 'azure-vm-list' as Y; filter "$.['X'].['properties.virtualMachine'].['id'] == $.['Y'].['properties.networkProfile'].networkInterfaces[*].['id'] and $.X.tags.owner exists"; show X;
10-29-2019 09:29 AM
Hi Lpingali,
I tried this one and could execute (the button isn't grey) but the results was empty because show no one and, the suscription have several cases.
11-06-2019 02:45 PM
Can you please open a ticket with screenshots of the results from both API calls, so we can debug further?
11-21-2019 07:43 PM
VRuiz,
Please try the below RQL.
config where cloud.account = 'Azure-Redlock-public-demo' AND api.name = 'azure-network-nic-list' as X; config where api.name = 'azure-vm-list' as Y; filter "$.['X'].['properties.virtualMachine'].id contains $.['Y'].['properties.osProfile'].computerName and $.X.tags.owner exists"; show X;
The issue you were running into is that $.['Y'].['properties.networkProfile'].networkInterfaces[*].id references the network interface Id, but that value doesn't exist in the nic-list response. So what you need to do is map from the NIC to the Computername.
11-22-2019 02:16 AM
Hi,
Thanks!!! That query works fine.
I think that I have two problems. The first one is that you comment with the merge about the nic id and the vm id. But, I think that the real problem form my query is in the tests that I made before, when the filter and variable syntaxis was wrong.
In the filter phrasse need to use a double quote "" and the X, Y and Z variables need to be called with ['X'].
Regards.
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!