# Logstash not indexing in Solr

**URL:** <https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243>\
**Category:** Logstash\
**Created:** [January 30, 2017, 4:31pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243 "2017-01-30T16:31:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Lima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuel_lima/32/41908_2.png) [@Samuel\_Lima](https://discuss.elastic.co/u/Samuel_Lima)\
**Post date:** [January 30, 2017, 4:31pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/1 "2017-01-30T16:31:34Z")

</div>

I'm trying to implement the following architecture:

Apache Log --\> Filebeat --\> Logstash --\> Solr

Apache and Filebeat run in the same VM.  
Logstash and Solr run each one on its own VM.

I know by the logs that Filebeat is sending data to Logstash.  
I also know that Logstash comunicates with Solr.  
But Solr does not index document, that is, Num. Docs are always 0.

The Logstash conf doc is as follow:  
\> input {

> ```
> beats {
> type => beats
> port => 5044
> }
> }
> filter {
> grok {
> match => { "message" => "%{COMMONAPACHELOG}" }
> }
> mutate {
> remove_field => ["offset","ident","input_type","source","message","type","tags","@version","beat","host"]
> }
> }
> output {
> 
> ```

> ```
> stdout { codec => rubydebug }
> 
> ```

> ```
> file {
> path => "/var/log/logstash/samuel.log"
> }
> 
> ```

> ```
> solr_http {
> solr_url => "http://172.27.1.108:8983/solr/tomcat1"
> }
> 
> ```

> ```
> }
> 
> ```

Is there anywhere I should see?

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 30, 2017, 5:16pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/2 "2017-01-30T17:16:32Z")

</div>

Have you had a look at your solr logs. And, or what may sit between logstash, Solr? What issues are you seeing?

---

<div class="post-metadata">

**Author:** ![Samuel\_Lima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuel_lima/32/41908_2.png) [@Samuel\_Lima](https://discuss.elastic.co/u/Samuel_Lima)\
**Post date:** [January 30, 2017, 8:09pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/3 "2017-01-30T20:09:05Z")

</div>

I found the folowing exception in the /opt/lucidworks/fusion/var/log/solr/solr.log.

It seems the problem is with Fusion not indexing the data.

> 2017-01-30T17:46:22,745 - WARN [qtp1766822961-21:LukeRequestHandler@607] - {node\_name=n:172.27.1.108:8983\_solr} - **Error getting file length for [segments\_c]**  
> **\> java.nio.file.NoSuchFileException: /opt/lucidworks/fusion/data/solr/tomcat1\_shard1\_replica1/data/index/segments\_c**  
> at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) ~[?:1.8.0\_102]  
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0\_102]  
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0\_102]  
> at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55) ~[?:1.8.0\_102]  
> at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144) ~[?:1.8.0\_102]  
> at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99) ~[?:1.8.0\_102]  
> at java.nio.file.Files.readAttributes(Files.java:1737) ~[?:1.8.0\_102]  
> at java.nio.file.Files.size(Files.java:2332) ~[?:1.8.0\_102]

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 30, 2017, 8:47pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/4 "2017-01-30T20:47:10Z")

</div>

So not so much of a Logstash issue. I would ask that you take a look into your Solr implementation.

---

<div class="post-metadata">

**Author:** ![guy\_davis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guy_davis/32/7068_2.png) [@guy\_davis](https://discuss.elastic.co/u/guy_davis)\
**Post date:** [January 31, 2017, 4:38am UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/5 "2017-01-31T04:38:54Z")

</div>

Good day,

I'm facing the same problem trying to get Logstash to output to Solr. Would you mind sharing the steps and/or schema.xml you used to create the Solr Collection that logstash-output-solr\_http is sending to?

Thanks much,  
Guy

---

<div class="post-metadata">

**Author:** ![rai](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rai](https://discuss.elastic.co/u/rai)\
**Post date:** [February 3, 2017, 8:12pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/6 "2017-02-03T20:12:23Z")

</div>

Hi Davis  
Are you able to resolve Solr issue? I am trying to create same pipe line with Logstash but don't see any document in solr. Can you please share the step which I need to follow to make it working?  
Thanks  
Rai

---

<div class="post-metadata">

**Author:** ![guy\_davis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guy_davis/32/7068_2.png) [@guy\_davis](https://discuss.elastic.co/u/guy_davis)\
**Post date:** [February 3, 2017, 9:02pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/7 "2017-02-03T21:02:46Z")

</div>

Yes, it feels very lonely trying to use the SILK logging stack instead of the much more popular ELK stack. Here's what I needed to do for Logstash to Solr on CentOS 7:

**Assuming you've already installed Logstash on CentOS or similar**  
sudo /usr/share/logstash/bin/logstash-plugin install logstash-output-solr\_http  
# Fix for [Solr6 & Logstash 5: timestamp error](https://discuss.elastic.co/t/solr6-logstash-5-timestamp-error/67223)  
sudo sed -i.bak -e 's/document["@timestamp"]/#document["@timestamp"]/g' /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-solr\_http-3.0.1/lib/logstash/outputs/solr\_http.rb

# Fix for [https://github.com/logstash-plugins/logstash-output-solr\_http/issues/3](https://github.com/logstash-plugins/logstash-output-solr_http/issues/3)

# Note, I could instead have added a soft commit below the add: @solr.commit :commit\_attributes =\> {:softCommit =\> true}

sudo sed -i -e 's/@solr.add(documents)/@solr.add(documents, :add\_attributes =\> {:commitWithin=\>1000})/g' /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-solr\_http-3.0.1/lib/logstash/outputs/solr\_http.rb\

Basically, the version of this plugin in Github fails to ever commit so no log events are ever searchable.

Hope this helps,  
Guy

---

<div class="post-metadata">

**Author:** ![rai](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@rai](https://discuss.elastic.co/u/rai)\
**Post date:** [February 3, 2017, 9:25pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/8 "2017-02-03T21:25:39Z")

</div>

thanks for reply. Do I still need to run the command which you have mentioned even I don't see any error in Logstash. One more thing I would like to mention that I am using third party docker image of logstash. Do I need to add any additional configuration file like schema.xml n all as I don't see any such files.

---

<div class="post-metadata">

**Author:** ![guy\_davis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guy_davis/32/7068_2.png) [@guy\_davis](https://discuss.elastic.co/u/guy_davis)\
**Post date:** [February 3, 2017, 9:48pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/9 "2017-02-03T21:48:00Z")

</div>

Hiya Rai,

I'm using the RPM logstash on CentOS 7 so can easily change this plugin. Would be trickier with Logstash in Docker.

Skip the first half of my diff about iso8601 issues if you're not seeing that problem. The 2nd part is the Solr commit to make log events appear in Silk.

As for Solr schema.xml, I'm not using one explicitly, instead relying upon dynamic fields from logstash. My Logstash pipeline has a mutate to rename @timestamp to timestamp\_dt:

```
filter {
  mutate {
    rename => { "@timestamp" => "timestamp_dt" }
  }
}
output {
    #stdout { codec => rubydebug }
  solr_http {
    solr_url => "http://SOLR_HOST:8983/solr/logs"
  }

```

}

To create the dynamic Solr collection named 'logs' I run:

```
sudo -u solr /opt/solr/bin/solr create -c logs -d /opt/solr/server/solr/configsets/data_driven_schema_configs/

```

Cheers,  
Guy

---

<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:** [March 3, 2017, 9:48pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-in-solr/73243/10 "2017-03-03T21:48:09Z")

</div>

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