# Hyperlink field combining multiple fields in query string

**URL:** <https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681>\
**Category:** Logstash\
**Created:** [July 5, 2018, 9:54am UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681 "2018-07-05T09:54:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thegrockq](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@thegrockq](https://discuss.elastic.co/u/thegrockq)\
**Post date:** [July 5, 2018, 9:54am UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/1 "2018-07-05T09:54:32Z")

</div>

I'm trying to add a hyperlink field to Kibana where the values of multiple fields are used to construct the query string. For example, I need to do something like this:

## Sample Fields

id: 135805885  
session: 08801509951900395808  
start\_date: 2018/06/19 13:33:16  
end\_date: 2018/06/19 13:33:16

## Desired URL

[https://xx.yy.com/some/path?id=135805885&session=08801509951900395808&start\_date=2018%2F06%2F19%2013%3A33%3A16&end\_date=2018%2F06%2F19%2013%3A33%3A16](https://xx.yy.com/some/path?id=135805885&session=08801509951900395808&start_date=2018%2F06%2F19%2013%3A33%3A16&end_date=2018%2F06%2F19%2013%3A33%3A16)

I've tried using LS to add a field where I build the query string, but then the entire query string is encoded and the hyperlink doesn't work as intended (i.e. the "=" and "&" are also URL encoded).

I attempted to use {{rawValue}} instead of {{value}} in Kibana, in hopes I could manually encode in LS using gsub for the chars I know will show up, but it didn't seem to work as expected (I expected the query string to be fully unencoded). I'm on ES 5.6.3.

Am I likely doing something wrong with the {{rawValue}}? Is the 'manual' gsub encoding in LS the best way to go?

Also - the start\_date and end\_date fields are actually sent as UNIX timestamps, and show up this was in Kibana when viewed as JSON, but they are displayed in the proper format in the table view and also in URL formatted string Kibana creates. Will I need the conversion in LS before I do the gsub, if I go that route?

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 12:33pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/2 "2018-07-05T12:33:03Z")

</div>

I've moved this question to the Logstash forum as you will likely get a better answer there.

---

<div class="post-metadata">

**Author:** ![yodog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yodog/32/4822_2.png) [@yodog](https://discuss.elastic.co/u/yodog)\
**Post date:** [July 5, 2018, 1:20pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/3 "2018-07-05T13:20:30Z")

</div>

> [@Add\_field to add a custom hyperlink](https://discuss.elastic.co/t/add-field-to-add-a-custom-hyperlink/36225):
>
> Is there any way to add a hyperlink to the data table? A clickable hyperlink? I am concatenating the field called Id, which lives in my document. I can get a url into the document, but it's not clickable, it's just plain text. This is what I am using: filter { mutate { add\_field =\> { "data Record" =\> "https://hyperlink\_url/%{Id}" } } }

> [@Make a value field in Kibana 4 clickable to follow link](https://discuss.elastic.co/t/make-a-value-field-in-kibana-4-clickable-to-follow-link/56207):
>
> I have a large number of webserver logs in elasticsearch and am using kibana 4 to explore them and look for different referral URLs. I occasionally want to click on the URL's. Right now I have to copy and paste them into another tab in my browser. It would be great if I could just click on them and have it open a new tab or at least in the current tab. I have made one other modification to the kibana code base so far and I'm starting to get the hang of it. I still unsure where everything is but …

---

<div class="post-metadata">

**Author:** ![thegrockq](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@thegrockq](https://discuss.elastic.co/u/thegrockq)\
**Post date:** [July 5, 2018, 1:44pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/4 "2018-07-05T13:44:09Z")

</div>

I know how to do this (and am doing this) for a single field. The issue is I specifically need values from multiple fields, and I specifically need them in a query string (where values like literal spaces, for example, are URL encoded as %20).

So far, if I build the query string in LS (which I'm doing), the whole field is URL encoded by Kibana. In Kibana, I can't build the query string using multiple fields with a field format formatter in Kibana (AFAIK).

---

<div class="post-metadata">

**Author:** ![thegrockq](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@thegrockq](https://discuss.elastic.co/u/thegrockq)\
**Post date:** [July 5, 2018, 1:47pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/5 "2018-07-05T13:47:46Z")

</div>

Thanks Bill.

I think there are two components to this, one LS and one Kibana. From the Kibana side, should using the URL field formatter, and {{rawValue}} as opposed to {{value}} to build the URL, result in a URL that is NOT URL encoded?

If so, I think I can figure this out, but so far, when I switched, it still appears to encode... Not clear what the expected output should be.

Thanks!

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 5:40pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/6 "2018-07-05T17:40:46Z")

</div>

I think rawValue should work and _not_ encode the value. Sounds like maybe that is not the case though. If you find issues with rawValue that sounds like a bug to me.

---

<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:** [August 2, 2018, 5:44pm UTC](https://discuss.elastic.co/t/hyperlink-field-combining-multiple-fields-in-query-string/138681/7 "2018-08-02T17:44:19Z")

</div>

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