# Unable to parse correctly a filter as part of a custom URL when field values contain apostrophe characters

**URL:** <https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789>\
**Category:** Kibana\
**Created:** [February 19, 2021, 5:28am UTC](https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789 "2021-02-19T05:28:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerardo\_Marcotrigian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerardo_marcotrigian/32/68913_2.png) [@Gerardo\_Marcotrigian](https://discuss.elastic.co/u/Gerardo_Marcotrigian)\
**Post date:** [February 19, 2021, 5:28am UTC](https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789/1 "2021-02-19T05:28:55Z")

</div>

Hi Everyone,

I’m struggling to create a link (from a table visualization) to a drill-down dashboard using scripted fields with the URL format template. This is the following:

s/my\_kibana\_space/app/kibana#/dashboard/c2dd0590-695a-11eb-84f5-1b2d4b2af8d6?\_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fd%2Cto%3Anow%2Fd))**&\_a=(filters:!((query:(match\_phrase:(dt:'{{value}}')))))**

The field **“dt”** represents a news headline/title from a news website. This URL perfectly works except when the field value contains an apostrophe like, for example, the following headline:

“MasterChef Celebrity: Jorge Lanata cuestionó la participación de María **O'Donnell** ”

The resulting URL with this example is:

[https://realtime.com.ar/s/my\_kibana\_space/app/kibana#/dashboard/c2dd0590-695a-11eb-84f5-1b2d4b2af8d6?\_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fd%2Cto%3Anow%2Fd)](https://realtime.com.ar/s/my_kibana_space/app/kibana#/dashboard/c2dd0590-695a-11eb-84f5-1b2d4b2af8d6?_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fd%2Cto%3Anow%2Fd)))&\_a=%28filters%3A%21%28%28query%3A%28match\_phrase%3A%28dt%3A%27MasterChef%20Celebrity%3A%20Jorge%20Lanata%20cuestion%C3%B3%20la%20participaci%C3%B3n%20de%20Mar%C3%ADa%20O'Donnell%27%29%29%29%29%29

In this case, Kibana shows the message: “Unable to parse URL” and doesn’t apply the filter needed.

I managed to parse correctly the URL replacing the apostrophe ' with ‘ (and other similar characters), but the value doesn't match (I suppose this is the expected behavior).

Is there an alternative way to create the custom URL with the apostrophe? I tried using double quotes but it didn't work. Is it possible to use any other character as a synonym for ' ?

Just in the case that it could be useful, I leave the mapping definition for the field dt below:

```auto
    "dt" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              },
              "fielddata" : true
            }

```

I know that in newer versions of Elastic/Kibana there’s a straightforward way to create a drill-down dashboard, but at the moment we have 7.6.2 and I need to solve that issue in this version. I look forward to working with the latest version soon.

Regards,  
Gerardo

---

<div class="post-metadata">

**Author:** ![brianseeders](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brianseeders/32/84831_2.png) [@brianseeders](https://discuss.elastic.co/u/brianseeders)\
**Post date:** [March 2, 2021, 9:42pm UTC](https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789/2 "2021-03-02T21:42:41Z")

</div>

Hey @Gerardo_Marcotrigian,

I believe the single-quote will be escaped correctly if you prepend it with `!`, for example `!'`.

So, `O'Donnell` would become `O!'Donnell`.

Can you give that a try and let me know how it works?

Brian

---

<div class="post-metadata">

**Author:** ![Gerardo\_Marcotrigian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerardo_marcotrigian/32/68913_2.png) [@Gerardo\_Marcotrigian](https://discuss.elastic.co/u/Gerardo_Marcotrigian)\
**Post date:** [March 3, 2021, 7:32pm UTC](https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789/3 "2021-03-03T19:32:26Z")

</div>

@brianseeders. That works perfectly!  
Thank you so much for your support 😃  
Regards,  
Gerardo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 31, 2021, 7:32pm UTC](https://discuss.elastic.co/t/unable-to-parse-correctly-a-filter-as-part-of-a-custom-url-when-field-values-contain-apostrophe-characters/264789/4 "2021-03-31T19:32:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
