Hi I have a problem with elk reported below, I have to call an api in elk search, I generated the key for elk from the web but when I insert it in the rest call I have the error reported below, how do I fix it?
http://localhost:9200/_search
Curl endpoint:
curl --location --request GET 'http://localhost:9200/_search' \
--header 'Authorization: Bearer b0ZuTkZZUUJKTnlvaWhUSjdIX206MEo4UnA4RTBSMGFzOGYteE9iTDF1Zw=='
Response:
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
"additional_unsuccessful_credentials": "oauth2 token: invalid token",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
}
],
"type": "security_exception",
"reason": "unable to authenticate with provided credentials and anonymous access is not allowed for this request",
"additional_unsuccessful_credentials": "oauth2 token: invalid token",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
},
"status": 401
}