Kibana 7.7.1 - saved search does not include search string quotations; escaping with %22 does not work - kibana

I tried to save a query with search query string like:
"order cancellation request received for userId = 123"
I need the whole string so I quote it with double quotations in the search bar. That query works but only until I save it and share the link.
When I save it with "Save" button top of search bar, or "disk" button at the left of search bar, the page reloads and my quotations are removed; now the results are not the same because the engine matches any of the words in the query and gets me more results.
When I check the url, I see this part:
...,query:(language:kuery,query:'order%20cancellation%20request%20received%20for%20userId%20%3D%20123'),...
Apparently, there are not quotations. So I tried to add %22 as how they should be encoded in URL, but no avail.
So, why? I expect Kibana to preserve the quotations in the search term.
Or, can someone suggests another kind of syntax which is valid, correct and shareable as an URL?

Nah. I found why.
You should add %22 inside 'xxxx' so that it would look like:
...,query:(language:kuery,query:'%22order%20cancellation%20request%20received%20for%20userId%20%3D%20123%22'),...

Related

Google Analytics Replace Homepage URL as "/" to Something Else

I'm looking to find a way to replace the home page URL that Google deems as "/" in my Google Analytics reports. I know Google sets "/" as the home page but in my reports, I want it to display "Home" instead.
I haven't found any solutions through Google. I'm thinking it's through filters somehow.
I've tried going through the GA settings and did a search on filters how to change this but no solutions. Thanks!
Although I would not recommend this, you can create a filter in a view (possibly not the default one as it's bad practice) with the following fields:
Regex explaination:
^ asserts position at start of a line
\/ matches the character / literally
$ asserts position at the end of a line
Filter configuration if the SS gets lost:
Filter type: Custom
Checbox: Search and Replace
Filter field: Request URI
Search string: ^(\/)$
Replace string: Home
Remember to verify your filter and to create an additional view if you do this.

why I cannot search words in dictionary with the url?

Why I cannot search words in dictionary with the url, for example
https://dictionary.cambridge.org/us/dictionary/english/Tea
returns its homepage, rather than the vocabulray page?
You can do this like this.
https://dictionary.cambridge.org/us/dictionary/english/<word>
You will get directly to the page. Please note that this is case sensitive. So you need to write tea and not Tea. Just replease the <word> with a word - If it exist then it will show you the page, if not then you will be redirected to the FrontPage. Or if you want to just use the search
https://dictionary.cambridge.org/us/spellcheck/english/?q=<word>

What is the optimal way to encode a tag to use in algolia?

I have an article page that lists the tags related to that article. When the user clicks on the tag it brings them to the Algolia search results page. This is a Wordpress website. Some of my tags happen to contain ampersands in them like "Spades & Shovels", for example.
What I've noticed is that when I urlencode this term it does not display the search term properly in the search box when I send it via a query string.
I've tried this and thought this was the secret sauce, but it doesn't always work.
$tag_name = json_encode(urlencode(html_entity_decode($tag->name)));
What would be the best way to encode a tag name so that when I pass it via a query string to the search results page it handles it properly?
I've done more testing and I am noticing some odd things on my search results page. If I come to the search page with the searchbox field empty, but pass a post_id (I'm dynamically loading the tags associated with a post in the filter section), I can see "Spades & Shovels" listed there and it has a count of "65" next to it.
If I type "Spades & Shovels" into the searchbox, I see that number quickly drop down to 10 in the sidebar.
When I pass the tag in the query string no matter how I encode it, it doesn't seem to work. I mean I see the words Spades & Shovel in the search box, but I don't get any results. Its very strange, but probably something simple I'm hoping to fix. I need to be able to pass & in a query string to my search results page, but I have not found the proper formula for sending an ampersand in the url for this to work.
It does seem like the value I am passing through in the query string is not an exact match to the actual tag name.
I have tried all of these possibilities and different combinations:
$clean_tag = json_encode(urlencode(html_entity_decode($tag->name)));
$clean_tag = htmlspecialchars_decode($clean_tag);
$clean_tag = html_entity_decode($clean_tag);
$clean_tag = urlencode($clean_tag);
$clean_tag = htmlentities($clean_tag);
$clean_tag = html_entity_decode($clean_tag);
$clean_tag = json_encode($clean_tag);
None of these seem to do the trick. Any thoughts?

Prevent ? from moving to query parameters

I'm working on some interesting APIs that have a "?" in their path, like so:
/api/?other/stuff/here
However, if I type "?" in the request URL in Paw, it automatically moves my cursor into the query parameter fields. Is there a way to disable this? I'm forced to use postman at the moment to work around this, which is less than ideal.
Nevermind, using %3F instead fixed the issue
As mentioned before, using %3F should work nicely!
Another, more generic way is to use the URL-Encode dynamic value:
Right-click on the field where you want to insert the special character and pick Encoding > URL-Encoding > Encode
A popup opens and you can type your special character (here ?) in the Input field. You should see the preview of the encoded value at the bottom of the popup.
Continue to type the end of the URL after this dynamic value. And you should be good to go!

PL/SQL escape character like for statement

I've tried to search but didn't found an answer.
I've created with PL/SQL, HTML, CSS and Javascript a web application.
People can search for article and write a comment to These articles.
If they click the submit button it starts to search with the conditions of the customer.
I send the conditions as param and store them into variables.
After that I start my Statement and refresh the page with the new records.
If someone writes a comment with Special characters like
(&, %, ", ', _)
my page crashes because the Statement string isn't correct anymore.
The Statement Looks like
SELECT * FROM myTable
WHERE Name LIKE ('''%'||nameVar||'%''');
Excuse my english
Thanks
Ok, first your question about "ESCAPING" lead me to the wrong way, because you can define a "ESCAPE" character for a like Statement: This would take your % or _ in your Statement literal:
where ..... like '%\%%' ESCAPE '\'
should find a record with an % in the column.
BUT THATS NOT YOUR PROBLEM!
Your web application has to HTML encode your string - then you can store it in any database.
This has to be done by your frontend (whatever it is: ASP.NET, PHP, etc ...)
After a short Google search I found this: HTF Package, the HTF.ESCAPE_SC function encodes the string to be useable in SQL Statements.
Maybe this link helps you: https://docs.oracle.com/cd/B14099_19/web.1012/b15896/pshtp.htm

Resources