# Replace default logs type with custom Type

**URL:** https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791
**Category:** Logstash
**Created:** [April 4, 2018, 5:08pm UTC](https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791 "2018-04-04T17:08:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)
#### Post date: [April 4, 2018, 5:08pm UTC](https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791/1 "2018-04-04T17:08:04Z")

</div>

In addition to the question I just raised, I would like to retain the type specified when calling Logstash (see curl request) - also within elastic. Right now, If I call logstash using the curl request below, Logstash Inserts the entry into Elastic with the **_logs_** type within the logstash-\* index. What I'm looking to do is to use the **_aws-metrics_** as the type instead of **_logs_** default. How would I achieve this?

> curl -H "content-type: application/json" -XPUT '[http://10.222.51.58:8080/aws-metrics](http://10.222.51.58:8080/aws-metrics)' --data '@/C/Users/Temp/Desktop/my-file.json'

```
output {
	stdout { 
		codec => rubydebug
	} 
	if[request_path] == "/aws-metrics" {
		elasticsearch {
			hosts => ["https://elasticsearch.myhost.com:443/"]
			index => "myapp-ls-%{+YYYY.MM.dd}"
			user => "elastic"
			password => "elastic"
		}
	}
}

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [April 4, 2018, 5:15pm UTC](https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791/2 "2018-04-04T17:15:10Z")

</div>

You could add 'document\_type =\> "aws-metrics"' to the output, but note that types are being [removed](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html) in V7.

---

<div class="post-metadata">

### Author: ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)
#### Post date: [April 4, 2018, 5:22pm UTC](https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791/3 "2018-04-04T17:22:56Z")

</div>

> [@Badger](#):
>
> document\_type

This works. Was trying out type =\> as suggested in some forum but it didnt work. wasnt able to create a google search strng enough to point to relevant resource. Thanks again.

---

<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: [May 2, 2018, 5:22pm UTC](https://discuss.elastic.co/t/replace-default-logs-type-with-custom-type/126791/4 "2018-05-02T17:22:57Z")

</div>

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