# Templates and alias question

**URL:** <https://discuss.elastic.co/t/templates-and-alias-question/125516>\
**Category:** Kibana\
**Created:** [March 25, 2018, 8:47pm UTC](https://discuss.elastic.co/t/templates-and-alias-question/125516 "2018-03-25T20:47:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)\
**Post date:** [March 25, 2018, 8:47pm UTC](https://discuss.elastic.co/t/templates-and-alias-question/125516/1 "2018-03-25T20:47:35Z")

</div>

I am trying to use Aliases concept in my sample and when I try to query the alias, it throws error:

{  
"error": "Incorrect HTTP method for uri [/log] and method [POST], allowed: [DELETE, HEAD, GET, PUT]",  
"status": 405  
}

```
         PUT {
	       "template": "log_*",
	       "aliases": {
		"log":{}
	}
	"settings": {
		"index": {
			"number_of_shards": 5,
			"number_of_replicas": 1
		}
	}
	"mappings": {
		"log_event": {
		
			"properties": {
				"log_name": {
					"type": "string"
				},
				"log_text": {
					"type": "string"
				},
				"log_data": {
					"type": "date"
				}
				
			}
		}
	
	}

}

       POST /log_03012018/_doc/1
      { "log_name": "March 1st 2018",
          "log_text": "this is my first doc",
           "log_data": "2018-10-10"
      }
        POST /log_03022018/_doc/1
           { "log_name": "March 2nd 2018",
               "log_text": "this is my sec doc",
               "log_data": "2019-10-10"
         }
        POST /log_03032018/_doc/1
          { "log_name": "March 3rd 2018",
              "log_text": "this is my sec doc",
              "log_data": "2019-10-10"
       }

     GET log
    {
             "query":
            { "match_all": {} }

      }
```

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [March 26, 2018, 1:10am UTC](https://discuss.elastic.co/t/templates-and-alias-question/125516/2 "2018-03-26T01:10:59Z")

</div>

> [@jason\_smith](#):
>
> Incorrect HTTP method for uri [/log] and method [POST], allowed: [DELETE, HEAD, GET, PUT]",
> 
> "status": 405

Hi  
Did you look at the breaking changes in 6.0 related to REST changes? You can find more info here:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking\_60\_rest\_changes.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_rest_changes.html)

Cheers  
Rashmi

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 23, 2018, 1:11am UTC](https://discuss.elastic.co/t/templates-and-alias-question/125516/3 "2018-04-23T01:11:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
