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

Logs API

rouaa
Newcomer

Hello, Im new to Dynatrace and im currently facing problems when trying to get the logs through the API, at first i thought i was a problem with the token, but now that i have a oauth token, it's still not working.

 

Can anyone help?

8 REPLIES 8

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

Could you share more details as which API are you using? Or which error are you getting?

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

rouaa
Newcomer

curl -X GET "https://{environmentid}.live.dynatrace.com/api/v2/logs/export?pageSize=5000" \
-H "Authorization: Bearer <oauth token>"

and even with Api-token it still doesnt work, this is the rror:

{
"error": {
"code": 401,
"message": "Couldn't resolve Platform token introspection. Endpoint returned 401. Token has expired, is inactive or user is inactive. IssueId: QJIRX3236BE2E5PV. Token identifier: dt0s02.ZBYZBBIB"
}
}i just checked the token is active in Dynatrace

Hi,

I would raise a support ticket to confirm why token is marked as expired, if it not expired.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

PacoPorro
Dynatrace Leader
Dynatrace Leader

AFAIK you need an API token for settings 2.0 , you don't need a Bearer.

PacoPorro_0-1716821479170.png

 

rouaa
Newcomer

i have oauth token already generated but my problem is with the command

Hi,

I think @PacoPorro has pointed you to root cause.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Hello, the token he's talking about is already generated but isnt giving me access

PacoPorro
Dynatrace Leader
Dynatrace Leader

To generate an access token

  1. Go to Access Tokens.
  2. Select Generate new token.
  3. Enter a name for your token.
  4. Select read.logs scope for the token.

  5. Select Generate token.

Featured Posts