# Error while indexing data using elasticsearch output plugin

**URL:** <https://discuss.elastic.co/t/error-while-indexing-data-using-elasticsearch-output-plugin/87712>\
**Category:** Logstash\
**Created:** [May 31, 2017, 10:04am UTC](https://discuss.elastic.co/t/error-while-indexing-data-using-elasticsearch-output-plugin/87712 "2017-05-31T10:04:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumit\_monga](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@sumit\_monga](https://discuss.elastic.co/u/sumit_monga)\
**Post date:** [May 31, 2017, 10:04am UTC](https://discuss.elastic.co/t/error-while-indexing-data-using-elasticsearch-output-plugin/87712/1 "2017-05-31T10:04:07Z")

</div>

I have a usecase where I have a big xml input file (currently testing with a 36 MB file but can be larger) and I am using logstash pipeline to convert this xml to json and then dumping the json to elasticsearch. I am getting the exception in the output stage as below

```
    ERROR logstash.outputs.elasticsearch - Got a bad response code
from server, but this code is not considered retryable. Request will be dropped {:code=>400, :response_body=>"{\"error\"
:{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to derive xcontent\"}],\"type\":\"parse_exception\",
\"reason\":\"Failed to derive xcontent\"},\"status\":400}"} 

```

The logstash configuration is attached below

```
input {

#beats {
 # port => 5044
  #}
  
  file {
  path => "D:\sdn_advanced\sdn_advanced.xml"
  start_position => "beginning"
  type => "sdn"
  codec => multiline {	
     pattern => "^<?xml"
     negate => "true"
     what => "previous"
	 max_lines => 1000000
	 max_bytes => "180 mb"
	 auto_flush_interval => 15
  }
   }
  
}

filter {

#ruby {
 # code => "event.set('correctmessage', event.get('message') + '</Sanctions>' + ' ' + 10.chr + ' ')"
#}

    xml {
    source => "message"
    target => "Sanctions"
    store_xml => "true"
    force_array => "false"
    }

    mutate {
    remove_field => ["path","@version","host","message","type","tags","correctmessage"]
    }

    }

    output {
      stdout {
      codec => json 
      }	
      
      elasticsearch {
      hosts => ["127.0.0.1:9200"]
      index => "sdn"
      retry_on_conflict => 3
      }
      
      #file {
      #path => "D:\Softwares\logstash-5.4.0\logstash-5.4.0\sdn_out.txt"
      #}
    }

```

Is there any max limit for the document size to be indexed into elasticsearch ??

---

<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:** [June 28, 2017, 10:04am UTC](https://discuss.elastic.co/t/error-while-indexing-data-using-elasticsearch-output-plugin/87712/2 "2017-06-28T10:04:24Z")

</div>

Closed on June 28, 2017, 10:04am UTC

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