# Unable to connect Logstash and Elasticsearch

**URL:** https://discuss.elastic.co/t/unable-to-connect-logstash-and-elasticsearch/82357
**Category:** Elasticsearch
**Created:** [April 13, 2017, 8:51pm UTC](https://discuss.elastic.co/t/unable-to-connect-logstash-and-elasticsearch/82357 "2017-04-13T20:51:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![likhita](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@likhita](https://discuss.elastic.co/u/likhita)
#### Post date: [April 13, 2017, 8:51pm UTC](https://discuss.elastic.co/t/unable-to-connect-logstash-and-elasticsearch/82357/1 "2017-04-13T20:51:36Z")

</div>

Hello,

I have installed Logstash, Elasticsearch and Kibana on my CentOS 7 machine. I was able to do the installations successfully. But when I try to access the apache access logs, it doesn't get the output. here is what I have done.

I've created a file sudo vi /etc/logstash/conf.d/01-webserver.conf

Added the following code in the file to access the logs:

input  
{  
file  
{  
path =\> "/var/log/httpd/access\_log"  
start\_position =\> "beginning"  
}  
}  
filter  
{  
if [type] == "apache-access"  
{  
grok  
{  
match =\> { "message" =\> "%{COMBINEDAPACHELOG}" }  
}  
}  
date  
{  
match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]  
}  
}  
output  
{  
elasticsearch  
{  
hosts =\> ["127.0.0.1:9200"]  
}  
stdout { codec =\> rubydebug }  
}

Then, I run this command to list the logstash indexes:

curl -XGET [http://127.0.0.1:9200/\_cat/indices?v](http://127.0.0.1:9200/_cat/indices?v)

It gives me this:

health status index pri rep docs.count docs.deleted store.size pri.store.size  
yellow open .kibana 1 1 1 0 3.1kb 3.1kb

It doesn't show any log related logstash indexes here.  
can you please help!!

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [April 13, 2017, 9:13pm UTC](https://discuss.elastic.co/t/unable-to-connect-logstash-and-elasticsearch/82357/2 "2017-04-13T21:13:52Z")

</div>

Do not cross-post the same requests. This is not acceptable.

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [April 13, 2017, 9:13pm UTC](https://discuss.elastic.co/t/unable-to-connect-logstash-and-elasticsearch/82357/3 "2017-04-13T21:13:59Z")

</div>


