# I defined ducument\_type=apachelogs in filebeat.prospectors, but having problem in if\[type\] == "apachelogs"

**URL:** <https://discuss.elastic.co/t/i-defined-ducument-type-apachelogs-in-filebeat-prospectors-but-having-problem-in-if-type-apachelogs/135303>\
**Category:** Logstash\
**Created:** [June 11, 2018, 7:23am UTC](https://discuss.elastic.co/t/i-defined-ducument-type-apachelogs-in-filebeat-prospectors-but-having-problem-in-if-type-apachelogs/135303 "2018-06-11T07:23:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dakshay](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dakshay](https://discuss.elastic.co/u/dakshay)\
**Post date:** [June 11, 2018, 7:23am UTC](https://discuss.elastic.co/t/i-defined-ducument-type-apachelogs-in-filebeat-prospectors-but-having-problem-in-if-type-apachelogs/135303/1 "2018-06-11T07:23:53Z")

</div>

Below is filebeat.yml  
filebeat:  
prospectors:  
-  
paths:  
- /home/st/Desktop/apache.log  
input\_type: log  
document\_type: apache\_logs  
-  
paths:  
- /home/st/Desktop/server.log  
input\_type: log  
document\_type: server\_logs  
output:  
logstash:  
hosts: ["localhost:5044"]  
bulk\_max\_size: 1024

conf.d

if[type] == "apache\_logs"{  
..  
..  
..  
}  
else if[type] == "server\_logs"{  
..  
..  
..  
}

logstash-plain.log  
[2018-06-11T12:41:20,229][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>6}  
[2018-06-11T12:41:20,230][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>6}  
[2018-06-11T12:41:20,321][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[//localhost:9200](https://localhost:9200)"]}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 11, 2018, 7:44am UTC](https://discuss.elastic.co/t/i-defined-ducument-type-apachelogs-in-filebeat-prospectors-but-having-problem-in-if-type-apachelogs/135303/2 "2018-06-11T07:44:17Z")

</div>

So what does an example event actually look like? Use a `stdout { codec => rubydebug }` output.

---

<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:** [July 9, 2018, 7:44am UTC](https://discuss.elastic.co/t/i-defined-ducument-type-apachelogs-in-filebeat-prospectors-but-having-problem-in-if-type-apachelogs/135303/3 "2018-07-09T07:44:18Z")

</div>

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