- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-10-2025 03:23 AM
Hi everyone,
I'm trying to use Cortex XDR and Cortex XSOAR to build a basic CMDB
In my XSOAR playbook, I run an XDR XQL query, then try to insert the results into an SQL database using the sql-command automation.
The command looks like this:
INSERT INTO Devices (
[hostname], [serial_number], [model], [MAC ADD], [IP Address],
[Vendor], [Profile], [Type], [Operating System],
[First Observed], [Last Observed], [Source Scan]
) VALUES (
'${hostname}', '${serial_number}', '${model}', '${mac}', '${ip}',
'${vendor}', '${profile}', '${profile_type}', '${OS_COMBINED}',
'${first_seen_date}', '${last_activity}', '${_COLLECTOR_TYPE}'
)
My problem:
All values are being inserted as empty strings in the SQL table.Has anyone successfully used context variables like ${hostname} in sql-command?
Is there a correct way to pass data from the playbook context into the SQL insert?
Thanks in advance!
07-10-2025 05:41 PM
Hi @tlmarques – If the variables (the values with the ${ } syntax) are resolving to empty strings, this most likely indicates a problem with the context paths. To test the context paths, open context data and paste in the full value (including the ${ }) in the search bar at the top. This will show the exact value that will be returned. If it is unexpectedly blank, that indicates a problem with your path. If these are incident fields, you may have forgotten the incident. at the beginning of the path.
07-10-2025 05:41 PM
Hi @tlmarques – If the variables (the values with the ${ } syntax) are resolving to empty strings, this most likely indicates a problem with the context paths. To test the context paths, open context data and paste in the full value (including the ${ }) in the search bar at the top. This will show the exact value that will be returned. If it is unexpectedly blank, that indicates a problem with your path. If these are incident fields, you may have forgotten the incident. at the beginning of the path.
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!