# Create indexs in elasticsearch using logstash & filebeat

**URL:** <https://discuss.elastic.co/t/create-indexs-in-elasticsearch-using-logstash-filebeat/152071>\
**Category:** Elasticsearch\
**Created:** [October 11, 2018, 2:26pm UTC](https://discuss.elastic.co/t/create-indexs-in-elasticsearch-using-logstash-filebeat/152071 "2018-10-11T14:26:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob\_ve](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bob\_ve](https://discuss.elastic.co/u/bob_ve)\
**Post date:** [October 11, 2018, 2:26pm UTC](https://discuss.elastic.co/t/create-indexs-in-elasticsearch-using-logstash-filebeat/152071/1 "2018-10-11T14:26:09Z")

</div>

I was not able to see any data or any indexs in elasticsearch . I was using filebeat --\> logstash --\> elasticsearch

## **filebeat.yml**

filebeat.inputs:

-\> type: log

> paths:  
> - /var/log/hadoop/hadoop/hive/gc.log\*  
> document\_type: hivemetastore
> 
> - type: log

**logstash.conf**

input {  
beats {  
port =\> 5044  
}  
}

output{

if [document\_type] == "hdfs" {  
elasticsearch {  
hosts =\> ["endpoint:443"]  
action =\> "index"  
index =\> "hdfs"  
}  
}

if [document\_type] == "hivemetastore" {  
elasticsearch {  
hosts =\> ["endpoint:443"]  
action =\> "index"  
index =\> "hive"  
}  
}

}

I'm not sure where i was doing wrong. without if condition i was able to see logs.

---

<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:** [November 8, 2018, 2:26pm UTC](https://discuss.elastic.co/t/create-indexs-in-elasticsearch-using-logstash-filebeat/152071/2 "2018-11-08T14:26:13Z")

</div>

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