Microsoft 365 defender advance hunting query

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Microsoft 365 defender advance hunting query

L2 Linker

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,

1 accepted solution

Accepted Solutions

L4 Transporter

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. 

 

View solution in original post

2 REPLIES 2

L4 Transporter

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. 

 

L2 Linker

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,

  • 1 accepted solution
  • 2054 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!