- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-08-2023 10:32 AM
Hi,
I'm trying to build an advance hunting query in Microsoft 365 defender integration, but still giving me error.
!microsoft-365-defender-advanced-hunting limit=10 query="""AlertInfo | where alertId = fa85caf1c0-b9b9-bc29-f600-08db44a419b9"""
Reason
Failed to execute microsoft-365-defender-advanced-hunting command.
Error:
Error in API call [400] - Bad Request
{"error": {"code": "BadRequest", "message": "Scalar is not expected in the current context. Fix semantic errors in your query.", "target": "|2528f983-4c3b7ab3bc866db1."}}
Could you help pls
Regards,
05-08-2023 12:30 PM
Ass!uming you're running this manually, try using the back ticks on the query argument instead of quotes:
!microsoft-365-defender-advanced-hunting query=`AlertInfo | where alert...`
Alternatively, you can add the argument debug-mode=true to have it throw the debug of the request and see the body that is being sent etc.
05-08-2023 12:30 PM
Ass!uming you're running this manually, try using the back ticks on the query argument instead of quotes:
!microsoft-365-defender-advanced-hunting query=`AlertInfo | where alert...`
Alternatively, you can add the argument debug-mode=true to have it throw the debug of the request and see the body that is being sent etc.
05-08-2023 02:26 PM
Got it.
Thank you.
!microsoft-365-defender-advanced-hunting limit=5 query=`AlertInfo | where AlertId == 'fa85caf1c0-b9b9-bc29-0000-08db40c26d06'`
Hope it helps someone.
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!