Closed mujamil90 closed 8 months ago
Can you please run the following command and paste the output here?
curl -s -k -u $K6_ELASTICSEARCH_USER:$K6_ELASTICSEARCH_PASSWORD -X POST "$K6_ELASTICSEARCH_URL/_security/user/_has_privileges?pretty" -H 'Content-Type: application/json' -d'
{
"index": [
{
"names": [
"filebeat-k6-metrics"
],
"privileges": [
"write", "create_index"
]
}
]
}'
I'm assuming here that K6_ELASTICSEARCH_URL
looks something like "https://my-host-name:9200". Please modify the example above accordingly.
The output should similar to:
{
"username" : "elastic-admin",
"has_all_requested" : true,
"cluster" : { },
"index" : {
"filebeat-k6-metrics" : {
"create_index" : true,
"write" : true
}
},
"application" : { }
}
Specifically has_all_requested
must be true
otherwise that user does not have sufficient permissions.
I have have sent curl request with port and without port _has_allrequested is false in both case. After checking with responsible person I found that User has rights but pattern for Index is started with "performancetest-*". Now I can see _has_allrequested is true
And I am not getting any error. Thank you for quick reply.
Great it works now and thanks for the follow-up! Closing now as your issue is resolved.
Hi,
I am using this extension to integrate K6 tests with our organization's Elastic search's instance. I have already integrated with locally hosted ES as per the README.md file. I am getting below error when creating index in ES after test execution.
I have provided details like K6_ELASTICSEARCH_URL, K6_ELASTICSEARCH_USER and K6_ELASTICSEARCH_PASSWORD inside K6 service in docker-compose.yml file. You can see it below:
Note: User already has permission to create index.