riahc3
(riahc3)
April 26, 2021, 9:42am
1
Sometimes Kibana times out when making certain large requests so I think I am forced to do it thru CLI.
Issue is that I do not know how to currently make the sintaxis.
I already generated a api key. For the sake of a example: t567ga-hYw15fgmrt6_123 That would be my API key.
And this is what I am trying to do:
PUT example-temp
{
"mappings": {
"properties": {
"geoip": {
"properties": {
"location": { "type": "geo_point" }
}
}
}
}
}
POST _reindex
{
"source": {
"index": "example"
},
"dest": {
"index": "example-temp"
}
}
DELETE example
PUT example
{
"mappings": {
"properties": {
"geoip": {
"properties": {
"location": { "type": "geo_point" }
}
}
}
}
}
POST _reindex
{
"source": {
"index": "example-temp"
},
"dest": {
"index": "example"
}
}
DELETE example-temp
Thank you for all the help as always
riahc3
(riahc3)
April 26, 2021, 9:49am
2
I tried this:
curl -H "Authorization: ApiKey t567ga-hYw15fgmrt6_123" -X POST "http://localhost:9200/_search" -d'
{
"query": {
"match_all": {}
}
}'
But I get as a reply:
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
riahc3
(riahc3)
April 26, 2021, 9:53am
3
Progressing:
curl -H "Authorization: ApiKey t567ga-hYw15fgmrt6_123" -H "Content-Type: application/json" -X POST "http://localhost:9200/_search" -d'
{
"query": {
"match_all": {}
}
}'
I get:
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_search]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_search]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}},"status":401}
riahc3
(riahc3)
April 26, 2021, 10:46am
4
Well I got it to work BUT it isnt with a api key:
curl --user adminuser:password -H "Content-Type: application/json" -X PUT "http://localhost:9200/example-temp" -d'{
"mappings": {
"properties": {
"geoip": {
"properties": {
"location": { "type": "geo_point" }
}
}
}
}
}'
curl --user adminuser:password -H "Content-Type: application/json" -X POST "http://localhost:9200/_reindex" -d'{
"source": {
"index": "example"
},
"dest": {
"index": "example-temp"
}
}'
curl --user adminuser:password -H "Content-Type: application/json" -X DELETE "http://localhost:9200/example"
curl --user adminuser:password -H "Content-Type: application/json" -X PUT "http://localhost:9200/example" -d'{
"mappings": {
"properties": {
"geoip": {
"properties": {
"location": { "type": "geo_point" }
}
}
}
}
}'
curl --user adminuser:password -H "Content-Type: application/json" -X POST "http://localhost:9200/_reindex" -d'{
"source": {
"index": "example-temp"
},
"dest": {
"index": "example"
}
}'
curl --user adminuser:password -H "Content-Type: application/json" -X DELETE "http://localhost:9200/example-temp"
system
(system)
Closed
May 24, 2021, 10:47am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.