Monday 15 August 2011

How to update part of my document in Elasticsearch -


I'm just starting with logstash and elastic search.

See the code snippet below in the Elasticsearch I host to Foo to bargag

I'm trying to update. Use to do this? Let me assume that I am running an elastic shark at localhost: 9 0000 .

 False "," _shards ": {" total ": 15," successful ": 15," failed ": 0}," hit ": {" total ": 8 "Adiktm_kor" 1.0, "hit": [{ "_index": "Logstas -20llk05kl8" "_type": "Apache_access", "_id": "YyncoyOeTgij9awBl3S4WQ", "_score" 1.0, "_source" { "message": "134.39.72.245 - - [18 / May / 2011: 12: 40: 18 - 0700] \" GET /favicon.ico HTTP / 1.1 \ "200 1189 \" - \ "\" Mozilla / 4.0 (compatible; Msaii 8.0; Windows NT 5.1; Trentdent / 4.0; .NET CLR 2.0.50727; NAT CLR 3.0.4506.2152; .NET CLR 3.5.30729; Infopath 2 .; .NET4.0C; .NET4.0E) \ "" , "@Version": "1", "@Stimest Mapping ":" 18 / May / 2011: 12: 40: 18 -0700 "," Action "," Action "," Merge ":" 2011-05-18T19: 40: 18.000Z "," Host ":" Bhargava "," Timestamp " "", "Replacement": "1.1", "Replacement": "200", "Bytes": "1189", "Referrer": "\" - \ "GET", "Request": "/ Favicon.ico", "httpversion" "," Agent ":" \ "Mozilla / 4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident / 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .net4.0E) \ ""}}, { "_index": "Logstas -2011.05.18", "_type": "apache_access", "_id": "smcxwrmtqzaiww-zUSE7MA", "_score": 1.0, "_source ": {" Message ":" 134.3 9 .72.245 - - [18 / May / 2011: 12: 40: 18 -0700] \ "GET /favicon.ico http / 1.1 \" 200 1189 \ "- \" \ " Mozilla /4k0 (compatible; Msaii 8.0; Windows NT 5.1; Trident / 4.0; NAT CLR 2.0.50727; NAT CLR 3k0k4506k2l52; NAT CLR 3.5.30729; Infopath 2 .; NT 4.0 C; NT 4.0 e) "" "@ Version": "1", "@Stemstamp": "2011-05-18T19: 40: 18.000Z", "Host": "Bhargava", "Path": "/ tmp / access_log", "Type": "Apache_access", "clientip": "134.39.72.245", "identity": "-", "auth": "-", "timestamp": "18 / May / 2011: 12 ":", "Response": "200", "bytes": "1189", "action": "received", "request": "/ favicon. Echo", "http version": "1.1" "," Referrer ":" \ "-" \ "," Agent ":" \ "Mozilla / 4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident / 4.0; .NET CLR 2.0.50727; .NET CLR 3.0. 4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E) \ ""}}}}}  

The only option here is to use partial updates

  curl -XPOST 'localhost: 9200 / test / type 1/1 / _update' -d '{ "Doctor": {"Host": "Bhargava"}} ' 

But then it can only be applied to one document. Out of the box for this, you can try.


No comments:

Post a Comment