# Failure to import data with logstash into elasticsearch

**URL:** <https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643>\
**Category:** Logstash\
**Created:** [June 30, 2015, 4:16pm UTC](https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643 "2015-06-30T16:16:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonc/32/3522_2.png) [@jasonc](https://discuss.elastic.co/u/jasonc)\
**Post date:** [June 30, 2015, 4:16pm UTC](https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643/1 "2015-06-30T16:16:15Z")

</div>

Using a kafka input, I'm getting the following error when importing data from a topic\_id:

```
{:exception=>#<ArgumentError: comparison of String with 13 failed>, :backtrace=>["org/jruby/RubyComparable.java:168:in `<'", "org/jruby/RubyString.java:1889:in `<'", "file:/opt/logstash/vendor/jruby/lib/jruby.jar!/jruby/java/java_ext/java.util.rb:82:in `[]'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/event.rb:73:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-codec-json-0.1.7/lib/logstash/codecs/json.rb:35:in `decode'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-kafka-0.1.15/lib/logstash/inputs/kafka.rb:169:in `queue_event'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-kafka-0.1.15/lib/logstash/inputs/kafka.rb:139:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:176:in `inputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:170:in `start_input'"], :level=>:error}  

```

The actual data pulled out of a kafka is:

```
[{"id": 231, "name": "Engineering"}, {"id": 232, "name": "Operations"}, {"id": 233, "name": "Design"}, {"id": 560, "name": "Business"}, {"id": 561, "name": "Legal"}, {"id": 562, "name": "Product"}, {"id": 563, "name": "Local Marketing and Support"}, {"id": 564, "name": "Expansion"}, {"id": 617, "name": "People Operations"}, {"id": 1369, "name": "Finance and Accounting"}, {"id": 1370, "name": "Public Policy and Communications"}, {"id": 1371, "name": "Growth Marketing"}, {"id": 7482, "name": "No Department"}]

```

The kafka input is:

```
kafka {
  topic_id => "greenhouse"
  type => "greenhouse"
}
```

---

<div class="post-metadata">

**Author:** ![jasonc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonc/32/3522_2.png) [@jasonc](https://discuss.elastic.co/u/jasonc)\
**Post date:** [July 2, 2015, 11:03pm UTC](https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643/2 "2015-07-02T23:03:15Z")

</div>

Was able to fix this by importing the data as codec =\> plain

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [July 17, 2015, 4:06pm UTC](https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643/3 "2015-07-17T16:06:25Z")

</div>

The problem was the array of JSON maps. The json codec expects one JSON  
object per line.

---

<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 6, 2017, 5:34am UTC](https://discuss.elastic.co/t/failure-to-import-data-with-logstash-into-elasticsearch/24643/4 "2017-07-06T05:34:21Z")

</div>


