Hello , This don't have to do anything with the escape character - Try below -
curl -XPUT 'http://localhost:9200/test/test/test' -d ' { "rules": [ { "users" : [ "foo\bar" ] } ] }' Thanks Vineeth On Thu, Sep 18, 2014 at 6:55 AM, Foobar Geez <[email protected]> wrote: > Hello, > I am a newbie to ES and would appreciate any insights into the below issue > (going crazy for the last couple of hours :/): > > I need to store the following string value into a field -- foo\bar -- with > the literal backslash in it. > > curl -XPUT 'http://localhost:9200/test/test/test' -d ' > { > "rules": [ > { > "users" : [ "foo\bar" ] > ] > }' > > I get the following error: > > {"error":"RemoteTransportException[[High-Tech][inet[/X.X.X.X:9300]][index]]; > nested: MapperParsingException[failed to parse [rules.users]]; nested: > JsonParseException[Unrecognized character escape 'k' (code 107)\n at > [Source: UNKNOWN; line: 10, column: 42]]; ","status":400} > > I tried "foo\\bar" and the value gets stored as "foo\\bar". > > Any ideas on how to store "foo\bar" with the literal backslash in it? > > Thanks in advance! > > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/1f4a3fb8-6835-4851-a354-acd5fa8f97bb%40googlegroups.com > <https://groups.google.com/d/msgid/elasticsearch/1f4a3fb8-6835-4851-a354-acd5fa8f97bb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kudnsHv-RrjLhpAVvXufUREVqKPZhn7shfzdxBm9sEEQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
