I am not an expert in Elasticsearch, hence forgive me if this question is very silly . I am trying to update a record in. elastic search but unable to achieve the goal. . Elastic Version. : 6.6.*
Requirement :- To update the field value.
Field name :- Source
Current Value. :- %{[beat][hostname]}"
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4ffc89c7; line: 5, column: 79]"}],"type":"json_parse_exception","reason":"Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4ffc89c7; line: 5, column: 79]"},"status":500}[root@rootlm01 scripts]# [root@rootlm01 scripts]#
Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.
Or use markdown style like:
```
CODE
```
This is the icon to use if you are not using markdown format:
There's a live preview panel for exactly this reasons.
Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
Hi All. ,
**I am not an expert in Elasticsearch, hence forgive me if this question is very silly . I am trying to update a record in. elastic search but unable to achieve the goal. .**
**Elastic Version. : 6.6.** *
Requirement :- To update the field value.
Field name :- Source
Current Value. :- %{[beat][hostname]}"
New Value. :- LMSS_APP_LOGIN
Update when matching condition
I tried following. :- but no luck.
*curl -X POST "http://localhost:9200/graylog* */ *update_by_query" -H 'Content-Type: application/json' -d'*
*{*
_ "script": {_
_ "inline":_
_ "ctx. <em>source.data.oldValues.source=ctx. *source.data.currentValues.source;*
_ ctx. *source.data.currentValues.source=params.newState.source;",*
_ "params": {</em>
_ "newState": {"source": "LMSS_APP_LOGIN" }_
_ }_
_ },_
_ "query": {_
_ "term": {_
_ "environment": "LMSS"_
_ }_
_ }_
*}*
'
}
Thrown following error.
**{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4ffc89c7; line: 5, column: 79]"}],"type":"json_parse_exception","reason":"Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@4ffc89c7; line: 5, column: 79]"},"status":500}[root@rootlm01 scripts]#**
**[root@rootlm01 scripts]#**
'
Reply
* [Update record in elasticsearch](https://discuss.elastic.co/t/update-record-in-elasticsearch/170410/2)
* #### created
![|20x20](https://avatars.discourse.org/v2/letter/r/4af34b/40.png)11d
* [
#### last reply
![|20x20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/40/12_2.png)1d
](https://discuss.elastic.co/t/need-help-to-update-record-in-elasticsearch-index/169295/5)
* 4
#### replies
* 57
#### views
* 2
#### users
* 2
#### links
* ![|32x32](https://avatars.discourse.org/v2/letter/r/4af34b/64.png)3
![|32x32](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/64/12_2.png)
8 DAYS LATER
[![|45x45](https://avatars.discourse.org/v2/letter/r/4af34b/90.png)](https://discuss.elastic.co/u/rajatdey80)
[rajatdey80](https://discuss.elastic.co/u/rajatdey80)[Rajat](https://discuss.elastic.co/u/rajatdey80)
[3d](https://discuss.elastic.co/t/need-help-to-update-record-in-elasticsearch-index/169295/2?u=rajatdey80)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.