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

Trying to fetch logs data from Dynatrace using GET API

VickyKumar
Newcomer_

Hi All,
I am trying to fetch logs data from Dynatrace using GET API using bearer authentication, but I am not able to do so. It is always throwing some error:
I have already provided required access to user, IAM polices and oauth client Scope required to get the logs from Dynatrace.

Scope access provided:
logs.ingest
logs.read
storage:logs:read

storage: buckets:read

API URL: 

curl -k -L -X GET  "https://{environmentid}.live.dynatrace.com/api/v2/logs/query"  -H "Authorization: Bearer Access_token"  -H "Accept: application/json" – d '{"query": "fetch logs | limit 10"}'

3 REPLIES 3

tomaxp
Observer

Try this

-H "Authorization: Bearer ${OAUTH_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"query": "fetch logs | limit 10",
"requestTimeout": "30s",
"preview": false
}'

 

curl -sS -X POST \
"https://{environmentid}.live.dynatrace.com/platform/storage/query/v1/query:execute" \
-H "Authorization: Bearer ${OAUTH_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"query": "fetch logs | limit 10",
"requestTimeout": "30s",
"preview": false
}'

Featured Posts