title: How To run Azure Log Analytics query api, Using python?
body: <p>I have been trying to run a log analytics query using python it was running on the below query</p>
  <pre><code>os.system(&quot;curl -X POST \'https://api.loganalytics.io/v1/workspaces/0000000000000000000000-0000-c05f0ccc198d/query\' -d \'{\&quot;query\&quot;: \&quot;ContainerLog\&quot;,\&quot;timespan\&quot;: \&quot;PT12H\&quot;}\' -H \'Authorization:Bearer&quot;+auth+&quot; \' -H \'Content-Type: application/json\'&quot;)
  </code></pre>
  <p>but it's not working on the below query</p>
  <pre><code>os.system(&quot;curl -X POST \'https://api.loganalytics.io/v1/workspaces/0000000000000000000000-c05f0ccc198d/query\' -d \'{\&quot;query\&quot;: \&quot;search in (ContainerLog) \&quot;error\&quot; | where TimeGenerated &gt; datetime(\&quot;2020-09-09\&quot;) | project LogEntry\&quot;}\' -H \'Authorization:Bearer &quot;+auth+&quot;\' -H \'Content-Type: application/json\'&quot;)
  </code></pre>
  <p>Error :</p>
  <p>{&quot;error&quot;:{&quot;message&quot;:&quot;The request had some invalid properties&quot;,&quot;code&quot;:&quot;BadArgumentError&quot;,&quot;correlationId&quot;:&quot;3cf07489-2a00-4ef6-9c00-15bd7d1be648&quot;,&quot;details&quot;:[{&quot;code&quot;:&quot;InvalidJsonBody&quot;,&quot;message&quot;:&quot;Unexpected token e in JSON at position 38&quot;,&quot;target&quot;:null}],&quot;innererror&quot;:{&quot;code&quot;:&quot;QueryValidationError&quot;,&quot;message&quot;:&quot;Failed parsing the query&quot;}}}</p>