Single Alias for multiple indices

Hi All,

Please help me to create a single alias linked to multiple indices. Required for visualization in kibana.
I am not able to create it from elastic search head plugin.
Please suggest.


The fourth example in the documentation shows how to do this. What is not working for you?

If you are looking for a user interface to do this through, it seems like Kopf has support for it, although I have not used this myself.

Hey ,

I am new to ELK and was trying to visualize data on dashboard. The dashboard is generated earlier and again a new index is created for different date with similar data respective to date which is not visible on dashboard previously created. I raised a conversation for the same and was suggested to post output from _cat/aliases" with single alias linked to both indices.

I just tried below & resulted error:-

http://localhost:9200/_aliases' -d '
"actions" : [
{ "add" : { "index" : "analysisleg2cnew", "alias" : "Index_Alias" } },
{ "add" : { "index" : "leg2mar17new", "alias" : "Index_Alias" } }

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No feature for name [_aliases' -d ' { "actions" : [ { "add" : { "index" : "leg2mar17new"]"}],"type":"illegal_argument_exception","reason":"No feature for name [_aliases' -d ' { "actions" : [ { "add" : { "index" : "leg2mar17new"]"},"status":400}

Please suggest where I am missing .

Did you try it using curl just as in the example? Did you send a POST request? What is the output of _cat/indices?

curl: (6) Could not resolve host: analysisleg2cnew
curl: (6) Could not resolve host: alias
curl: (6) Could not resolve host: Index_Alias

I am getting these in curl command line.

Yes it is a POST request ,I doubt I am missing something with curl may be.

Looks like you are sending invalid URLs through curl. Without seeing the actual commends you are trying there is little we can do to help.

Agree to you but I have not used CURL earlier & because of that I might be missing something .

Please suggest if you find there is a mistake with the command below -
curl -XPOST 'http://localhost:9200/_aliases' -d ' { "actions" : [ {"add"
: { "index" : "analysisleg2cnew", "alias" : "alias1" } }, { "add" : { "index" :
"leg2mar29", "alias" : "alias1" } } ] }'

Then I would try to run it once again to get proper comment.

What is the output of curl http://localhost:9200/_cat/indices ?

curl http://localhost:9200/_cat/indices?
yellow open .kibana 1 1 46 6 75.7kb 75.7kb
yellow open leg2mar29 5 1 147144 0 69.3mb 69.3mb
yellow open timediff 5 1 750 0 308.8kb 308.8kb
yellow open leg2mar17new 5 1 16 0 40.4kb 40.4kb
yellow open analysisleg2c 5 1 15007 0 6.9mb 6.9mb
yellow open analysisleg2cnew 5 1 15007 0 7mb 7mb
yellow open timediff_batchadded 5 1 1500 0 524.2kb 524.2kb

As far as I can see this looks OK. What is the response when running it?

{"error":{"root_cause":[{"type":"parse_exception","reason":"Failed to derive xco
ntent"}],"type":"parse_exception","reason":"Failed to derive xcontent"},"status"
:400}curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: alias1
curl: (3) [globbing] unmatched close brace/bracket in column 1

I created the two indices empty locally and ran the command without any problems. Which version of Elasticsearch are you using? Which operating system are you on?

Elasticsearch- 2.1.0
OS -Windows

Then it might very well be something related to curl on Windows. I will unfortunately not be able to help you there as I do not have any Windows box available.

Ok thanks for help & patience but in that case do I have any option to resolve below one -