About the prefix part I think it should not matter. Just put your prefix instead of ' None .<ADDRESS>'
I figured it was something with syntax but I thought single ticks inside double quotes should work without escaping 😀
@<1526734383564722176:profile|BoredBat47> Can you please share the exact command that you are running?
curl -XPOST -H 'Content-Type: application/json' 'localhost:9200/events-training_debug_image-*/_update_by_query?conflicts=proceed' -d'{
"script": {
"source": "ctx._source.url = ctx._source.url.replace('http://<MY_OLD_ADDRESS>', '
.<NEW_ADDRESS>')",
"lang": "painless"
},
"query": {"prefix": {"url": {"value": "http://<MY_OLD_ADDRESS>"}}}
}'
Hi @<1526734383564722176:profile|BoredBat47> , please try to remove the ", "case_insensitive": true" from the last line of the command that I sent to you
@<1722061389024989184:profile|ResponsiveKoala38> Sure, I'll get back to you as it finishes
@<1526734383564722176:profile|BoredBat47> Please try running the following command
curl -XPOST -H 'Content-Type: application/json' 'localhost:9200/events-training_debug_image-*/_update_by_query?conflicts=proceed' -d'{
"script": {
"source": "ctx._source.url = ctx._source.url.replace('
.<OLD_ADDRESS>', '
.<NEW_ADDRESS>')",
"lang": "painless"
},
"query": {"prefix": {"url": {"value": "
.<OLD_ADDRESS>", "case_insensitive": true}}}
}'
Hi @<1526734383564722176:profile|BoredBat47> , did the last update urls command work for you? I want to update our documentation
Yeah, they should:) The problem is that they are inside outer single quotes -d'{...}'
Should I remove "case-sensitive" option from a query?
Please let me know if it fixes the UI. I will ask to update our documentation then
@<1722061389024989184:profile|ResponsiveKoala38> Thanks a lot for the help. Keep up the good work!
@<1722061389024989184:profile|ResponsiveKoala38> Hello. What if my old fileserver address was not matching the None scheme? It was http and didn't have a domain, only ip address. Should I put my old address as it was in the replace method?
You'd have to change the URLs in elastic itself
@<1722061389024989184:profile|ResponsiveKoala38> It fixed the issue!
@<1722061389024989184:profile|ResponsiveKoala38>
Hi @<1526734383564722176:profile|BoredBat47> , do you mean new debug samples or old ones? Please note that older debug samples were registered to the previous URL
@<1523701070390366208:profile|CostlyOstrich36> Yes, I know. Above I posted a link where there's a solution. DB request to elastic to change those URLs. My question is: where to send this DB request? What endpoint? Request provided in FAQ in incomplete. It lacks URL where to send the request to.
curl --header "Content-Type: application/json" \
--request POST \
--data '{
"script": {
"source": "ctx._source.url = ctx._source.url.replace('
.<OLD_ADDRESS>', '
.<NEW_ADDRESS>')",
"lang": "painless"
},
"query": {
"match_all": {}
}
}' \
@<1722061389024989184:profile|ResponsiveKoala38> Shouldn't the escape slash be before the quote?
It's the same request you provided just without "case_sensitive" option and with my endpoints @<1722061389024989184:profile|ResponsiveKoala38>
Can you please share it as a text
It is indistinguishable visually but I want to make sure that each single quote is replaced with single quote slash single quote single quote
and not single quote slash double quote
A bit confusing. But this is what linux shell wants if you have single quotes inside double quotes inside outer single quotes
No. It is actually string concatenation. What you actually get is that an original string is broken into several parts. That are concatenated as following:
-d'{....' + ' + '....}'
@<1722061389024989184:profile|ResponsiveKoala38> Got following error. Sorry for a screenshot, I can't copy text from web terminal I am using right now.