# Does influx support regexp (or similar) please?

**URL:** <https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125>\
**Category:** Telegraf\
**Tags:** influxdb\
**Created:** [May 11, 2018, 8:25am UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125 "2018-05-11T08:25:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwang](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jwang](https://community.influxdata.com/u/jwang)\
**Post date:** [May 11, 2018, 8:25am UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125/1 "2018-05-11T08:25:29Z")

</div>

Dear All,

I wish to have some query like mysql:  
select \* from api where hostname like ‘thw-dv-lamp-01%’ limit 1;

it failed with:  
ERR: error parsing query: found like, expected ; at line 1, char 34

Please shed some light.

Apologize if the question is too newbie.

Thanks a lot in advance

---

<div class="post-metadata">

**Author:** ![jwang](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jwang](https://community.influxdata.com/u/jwang)\
**Post date:** [May 11, 2018, 1:31pm UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125/2 "2018-05-11T13:31:04Z")

</div>

would you please shed some light?  
thanks a lot in advance

---

<div class="post-metadata">

**Author:** ![jbbd](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jbbd](https://community.influxdata.com/u/jbbd)\
**Post date:** [May 11, 2018, 3:01pm UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125/3 "2018-05-11T15:01:39Z")

</div>

Sure, like this:

SELECT mean(“usage\_idle”) AS “mean\_usage\_idle” FROM “telegraf”.“autogen”.“cpu” WHERE time \> now() - 1h AND **(“host”=~/node/)** AND “cpu”=‘cpu-total’ GROUP BY host  
name: cpu  
tags: host=node001  
time mean\_usage\_idle

* * *

1526047229315210467 99.41784986722456

name: cpu  
tags: host=node01  
time mean\_usage\_idle

* * *

1526047229315210467 86.51526314639102

name: cpu  
tags: host=node02  
time mean\_usage\_idle

* * *

1526047229315210467 88.25015140382432

name: cpu  
tags: host=node03  
time mean\_usage\_idle

* * *

1526047229315210467 85.26376674950833

---

<div class="post-metadata">

**Author:** ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)\
**Post date:** [May 11, 2018, 3:15pm UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125/4 "2018-05-11T15:15:08Z")

</div>

It is possible but you should be careful using regex if you have high cardinality in your database. IF you have a lot of tags and values then regex can impact the server significantly.

> **[Data exploration using InfluxQL | InfluxDB OSS 1.7 Documentation](https://docs.influxdata.com/influxdb/v1.5/query_language/data_exploration/#regular-expressions)**
>
> Explore time series data using InfluxData’s SQL-like query language. Understand how to use the SELECT statement to query data from measurements, tags, and fields.

---

<div class="post-metadata">

**Author:** ![jwang](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jwang](https://community.influxdata.com/u/jwang)\
**Post date:** [May 11, 2018, 7:37pm UTC](https://community.influxdata.com/t/does-influx-support-regexp-or-similar-please/5125/5 "2018-05-11T19:37:22Z")

</div>

@jbbd and @philb: thanks a lot indeed
