# Grafana colored logs and elasticsearch lucene query

**URL:** <https://discuss.elastic.co/t/grafana-colored-logs-and-elasticsearch-lucene-query/285541>\
**Category:** Elasticsearch\
**Created:** [September 30, 2021, 6:43am UTC](https://discuss.elastic.co/t/grafana-colored-logs-and-elasticsearch-lucene-query/285541 "2021-09-30T06:43:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexG](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@AlexG](https://discuss.elastic.co/u/AlexG)\
**Post date:** [September 30, 2021, 6:43am UTC](https://discuss.elastic.co/t/grafana-colored-logs-and-elasticsearch-lucene-query/285541/1 "2021-09-30T06:43:51Z")

</div>

I have colored logs (Ansible logs) in Elasticsearch.  
Logs are displayed normally (colored) in Grafana.

If I execute a lucence query using a Number field, the logs will be displayed in color:

![screenshot 1](https://i.stack.imgur.com/orNBc.jpg)

![screenshot 2](https://i.stack.imgur.com/4btnY.jpg)

But if I execute lucence query using a field of type String, the logs will be displayed without colors and with escape characters:

![screenshot 3](https://us1.discourse-cdn.com/elastic/original/3X/0/5/058a909e5a8090e3211346f1759eac63bbd20300.jpeg)

 ![screenshot 4](https://us1.discourse-cdn.com/elastic/original/3X/8/8/888e88839d03b2e170104b28e8d64aac15db1cd6.jpeg)

How can I get colored logs with fields of type String?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 30, 2021, 9:49pm UTC](https://discuss.elastic.co/t/grafana-colored-logs-and-elasticsearch-lucene-query/285541/2 "2021-09-30T21:49:16Z")

</div>

This seems more of a grafana question than an Elasticsearch one, given it's the UI.

---

<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:** [October 28, 2021, 9:49pm UTC](https://discuss.elastic.co/t/grafana-colored-logs-and-elasticsearch-lucene-query/285541/3 "2021-10-28T21:49:37Z")

</div>

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