# Trying to index text file into ES, but getting below error

**URL:** <https://discuss.elastic.co/t/trying-to-index-text-file-into-es-but-getting-below-error/114677>\
**Category:** Elasticsearch\
**Created:** [January 9, 2018, 10:05am UTC](https://discuss.elastic.co/t/trying-to-index-text-file-into-es-but-getting-below-error/114677 "2018-01-09T10:05:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep1](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@Pradeep1](https://discuss.elastic.co/u/Pradeep1)\
**Post date:** [January 9, 2018, 10:05am UTC](https://discuss.elastic.co/t/trying-to-index-text-file-into-es-but-getting-below-error/114677/1 "2018-01-09T10:05:49Z")

</div>

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "json\_parse\_exception",  
"reason" : "Unexpected character ('-' (code 45)): Expected space separating root-level values\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@6b8e4b46; line: 1, column: 6]"  
}  
],  
"type" : "json\_parse\_exception",  
"reason" : "Unexpected character ('-' (code 45)): Expected space separating root-level values\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@6b8e4b46; line: 1, column: 6]"  
},  
"status" : 500  
}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 9, 2018, 3:15pm UTC](https://discuss.elastic.co/t/trying-to-index-text-file-into-es-but-getting-below-error/114677/2 "2018-01-09T15:15:33Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Could you provide a full recreation script as described in

> [@About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21):
>
> The heart of the free and open Elastic Stack Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease. warning PLEASE READ THIS SECTION IF IT'S YOUR FIRST POST Some useful links: [elasticsearch reference guide](http://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)[elasticsearch user guide](http://www.elastic.co/guide/en/elasticsearch/guide/current/index.html)[elasticsearch plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)[elasticsearch cl…](https://www.elastic.co/guide/en/elasticsearch/client/index.html)

It will help to better understand what you are doing.  
Please, try to keep the example as simple as possible.

---

<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:** [February 6, 2018, 3:15pm UTC](https://discuss.elastic.co/t/trying-to-index-text-file-into-es-but-getting-below-error/114677/3 "2018-02-06T15:15:59Z")

</div>

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