# How to include special characters in modified index pattern string. When using URL Format and 'value' label template

**URL:** <https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284>\
**Category:** Kibana\
**Created:** [October 25, 2019, 2:35pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284 "2019-10-25T14:35:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apollyon](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Apollyon](https://discuss.elastic.co/u/Apollyon)\
**Post date:** [October 25, 2019, 2:35pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/1 "2019-10-25T14:35:34Z")

</div>

Hello,

On kibana and when editing the values on an Index Pattern, e.g. from the default 'string' to URL. When modifying the URL template to include a value, e.g. an email address, is there a way to take in this value to ignore special characters? As this works with just text/ numerical values like names and IP's.

> '@ : ; '

As an example:

Below is the URL Template

```
http://localhost:5601/app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-3d,to:now))&_a=(columns:!(_source),index:'An%20indexname',interval:auto,query:(language:kuery,query:'email:{{value}}'),sort:!(!('@timestamp',desc)))

```

Below is the Label Template

```
{{value}}

```

As can see with the modified link to include the value, when taking in the value an error keeps appearing about being unable to load the data due to ..

> 'KQLSyntaxError': Expected AND, OR, end of input, whitespace but "@" found .....

So is there a way to be able to allow it or get it to ignore this and to be able to take it in as normal valued data?

Thank you!

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [October 25, 2019, 6:21pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/2 "2019-10-25T18:21:48Z")

</div>

Try using `{{rawValue}}` instead of `{{value}}` in the URL template.

---

<div class="post-metadata">

**Author:** ![Apollyon](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Apollyon](https://discuss.elastic.co/u/Apollyon)\
**Post date:** [October 29, 2019, 4:24pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/3 "2019-10-29T16:24:22Z")

</div>

hey @nickpeihl  
thank you for the above!

I gave this a try with using **{{rawValue}}** but it is now not showing up with anything.  
But when using the **{{value}}** the data is displayed again but coming up with the drill-down, it displays the same error.

Have been thinking about and using "Scripted Fields", so may give that a go 🤔.

Also, looking at this post about [hyperlinking](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/6)?

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [October 31, 2019, 8:55pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/4 "2019-10-31T20:55:34Z")

</div>

Sorry, I am unable to reproduce the issue. What version of Kibana are you on?

My url template looks like this.  
`http://localhost:5601/app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-3d,to:now))&_a=(columns:!(_source),index:'An%20indexname',interval:auto,query:(language:kuery,query:'email:{{rawValue}}'),sort:!(!('@timestamp',desc)))`

The link works as expected.

---

<div class="post-metadata">

**Author:** ![Apollyon](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Apollyon](https://discuss.elastic.co/u/Apollyon)\
**Post date:** [November 7, 2019, 3:44pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/5 "2019-11-07T15:44:30Z")

</div>

Hey @nickpeihl,  
Apologies for the response!  
Thank you for your help on this!

I am on Kibana 7.4.1.

When I try using `{{rawValue}}` the fields become blank still.

Would the fact, i've just thought, that when this data is collected it is collected in `''` so an email address will be displayed as `'email@email.com'`. Would this have an effect?

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [November 7, 2019, 6:13pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/6 "2019-11-07T18:13:55Z")

</div>

Ah, I think this is a bug. I was trying on 7.4.0. But now I see [this bugfix](https://github.com/elastic/kibana/pull/46332) that went into 7.4.2. Can you upgrade to 7.4.2 and see if the issue remains?

---

<div class="post-metadata">

**Author:** ![Apollyon](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Apollyon](https://discuss.elastic.co/u/Apollyon)\
**Post date:** [November 8, 2019, 11:41am UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/7 "2019-11-08T11:41:09Z")

</div>

Ahh I see!

I have just upgraded to 7.4.2 and it is still showing the same issue with using `{{rawValue}}` within the link.

The bug still remains!

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [November 13, 2019, 5:57pm UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/8 "2019-11-13T17:57:03Z")

</div>

Can you provide a example of a document that fails? Without a reproducible example I can not determine if this is a bug and how to fix it.

---

<div class="post-metadata">

**Author:** ![Apollyon](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Apollyon](https://discuss.elastic.co/u/Apollyon)\
**Post date:** [November 14, 2019, 11:46am UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/9 "2019-11-14T11:46:20Z")

</div>

Hey @nickpeihl,  
Thank you again for the tried help with this!

Below is maybe a better breakdown of an example.

Index field value pattern = "Recipients.keyword"  
The normal data displayed in the field is an email as shown = 'jon.doe@email.com'

When creating a visualization, and using the "Recipients.keyword" term, the field is not displayed but when put with a secondary field e.g. count, the count is displayed along to the blank field. (Screenshots - data-for-vis.PNG / rawvalue.PNG)

Index term pattern set up

Format = Url  
Type = Link  
Open new tab = ticked (Yes)

Link used for the URL Template -

```
http://localhost:5601/app/kibana#/discover?_g=(refreshInterval:(pause:!t,value:0),time:(from:now-30m,to:now))&_a=(columns:!(_source),index:'8d78acd0-021b-11ea-ac2a-03fa520b5739',interval:auto,query:(language:kuery,query:'Recipients.keyword:{{rawValue}}'),sort:!(!('@timestamp',desc)))

```

Label Template - (rawvalue-indexfield.PNG)

```
{{rawValue}}

```

* * *

When preforming the same as above with the Label Template - (value-indexfield.PNG)

```
{{value}}

```

The email is displayed in the intended visualization.

But when going to drill down on the address, when on the search page, the an error is displayed. About "KQLSyntaxError"

 ![rawvalue](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c6725cf815a34d1c8e9fb122e9e93be15ed1661e.png) ![data-for-vis](https://us1.discourse-cdn.com/elastic/original/3X/2/8/28a222f86eb56c26e238d9725957abed51f78bca.png)  
 ![rawvalue-indexfield](https://us1.discourse-cdn.com/elastic/original/3X/5/6/56125480d9575f8302b91ece430479eeceda3f78.png) ![value-indexfield](https://us1.discourse-cdn.com/elastic/original/3X/5/0/508d42987ae0ecdc543b1489883f55b3d0f2a143.png)

---

<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:** [December 12, 2019, 11:46am UTC](https://discuss.elastic.co/t/how-to-include-special-characters-in-modified-index-pattern-string-when-using-url-format-and-value-label-template/205284/10 "2019-12-12T11:46:28Z")

</div>

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