# Logstash doesn't index when I restart the services but works when I test it

**URL:** <https://discuss.elastic.co/t/logstash-doesnt-index-when-i-restart-the-services-but-works-when-i-test-it/100095>\
**Category:** Logstash\
**Created:** [September 11, 2017, 4:46pm UTC](https://discuss.elastic.co/t/logstash-doesnt-index-when-i-restart-the-services-but-works-when-i-test-it/100095 "2017-09-11T16:46:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharathdev](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bharathdev](https://discuss.elastic.co/u/bharathdev)\
**Post date:** [September 11, 2017, 4:46pm UTC](https://discuss.elastic.co/t/logstash-doesnt-index-when-i-restart-the-services-but-works-when-i-test-it/100095/1 "2017-09-11T16:46:48Z")

</div>

Here is my conf file in /etc/logstash/conf.d/apachelog.conf...I don't see index in kibana

But when i enter this command it works  
/opt/logstash/bin/logstash -f /etc/logstash/conf.d/apachelog.conf  
and I see the index in elasticsearch

I want to start it when i restart my services like **"service logstash start"**

```
input {
file {
path => "/var/log/apache2/access.log"
type => "apache_log" # a type to identify those logs (will need this later)
start_position => "beginning"
sincedb_path => "/dev/null" #to clear since db
}
}

filter {
grok {
match=> { message => "%{COMBINEDAPACHELOG}" }
}
date {
locale => "en"
match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z"]
}
}

output {
#stdout { }
elasticsearch {
hosts => ["localhost:9200"]
sniffing => true
manage_template => false
index => "mylogs"

}

}
```

---

<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:** [September 11, 2017, 6:23pm UTC](https://discuss.elastic.co/t/logstash-doesnt-index-when-i-restart-the-services-but-works-when-i-test-it/100095/2 "2017-09-11T18:23:50Z")

</div>

Does the logstash user have read access to /var/log/apache2/access.log?

---

<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:** [October 9, 2017, 6:24pm UTC](https://discuss.elastic.co/t/logstash-doesnt-index-when-i-restart-the-services-but-works-when-i-test-it/100095/3 "2017-10-09T18:24:25Z")

</div>

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