This commit is contained in:
David Laufer 2018-08-02 11:18:56 +03:00
parent e205db989c
commit 5be088cf70

View File

@ -56,9 +56,9 @@ aadToken = jsonResponse["access_token"]
``` ```
where where
- $tenantId: ID of the tenant on behalf of which you want to run the query (i.e., the query will be run on the data of this tenant) - tenantId: ID of the tenant on behalf of which you want to run the query (i.e., the query will be run on the data of this tenant)
- $appId: ID of your AAD app (the app must have 'Run advanced queries' permission to WDATP) - appId: ID of your AAD app (the app must have 'Run advanced queries' permission to WDATP)
- $appSecret: Secret of your AAD app - appSecret: Secret of your AAD app
## Run query ## Run query
@ -107,6 +107,8 @@ To iterate over the results do the below:
for result in results: for result in results:
print(result) # Prints the whole result print(result) # Prints the whole result
print(result["EventTime"]) # Prints only the property 'EventTime' from the result print(result["EventTime"]) # Prints only the property 'EventTime' from the result
``` ```
@ -120,6 +122,7 @@ output = csv.writer(outputFile)
output.writerow(results[0].keys()) output.writerow(results[0].keys())
for result in results: for result in results:
output.writerow(result.values()) output.writerow(result.values())
outputFile.close() outputFile.close()
``` ```