-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Open
Labels
Feature:ConsoleDev Tools Console FeatureDev Tools Console FeatureFeature:Dev ToolsTeam:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and moreDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and morebugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experience
Description
Escaping using the three ticks syntax in combination with backslashes can result in differently stored documents (maybe this is documented and I didnt find it, but I think it's worth mentioning somewhere). Take this example
PUT foo/bar/1
{
"message" : """
*\\!DMAlock*_
"""
}
PUT foo/bar/2
{
"message" : "*\\!DMAlock*_"
}
GET foo/bar/_mget
{"ids":["1","2"]}
# response
{
"docs": [
{
"_index": "foo",
"_type": "bar",
"_id": "1",
"_version": 3,
"found": true,
"_source": {
"message": """*\\!DMAlock*_"""
}
},
{
"_index": "foo",
"_type": "bar",
"_id": "2",
"_version": 1,
"found": true,
"_source": {
"message": "*\\!DMAlock*_"
}
}
]
}
As you can see, the response looks fine. However returning the documents via curl reveal, that the source is actually different
curl -u elastic:changeme localhost:9200/foo/bar/_mget?pretty -d '{"ids":["1","2"]}'
{
"docs" : [
{
"_index" : "foo",
"_type" : "bar",
"_id" : "1",
"_version" : 3,
"found" : true,
"_source" : {
"message" : "*\\\\!DMAlock*_"
}
},
{
"_index" : "foo",
"_type" : "bar",
"_id" : "2",
"_version" : 1,
"found" : true,
"_source" : {
"message" : "*\\!DMAlock*_"
}
}
]
}
As you can see the number of backslashes is different, two versus four.
gmoskovicz
Metadata
Metadata
Assignees
Labels
Feature:ConsoleDev Tools Console FeatureDev Tools Console FeatureFeature:Dev ToolsTeam:Kibana ManagementDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and moreDev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and morebugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experience