As of version 9 of Grafana there is no easy way to implement this.
You can create variable of the type "Text box" and use it for filtering. Rather nice approach in this case would be to use "Filter data by values" transformation with "match any" and all columns listed with regex filter .*$query.*
, but Grafana 9 (and older versions) doesn't support variables in transformations.
There considerations to add support for this in Grafana 10, AFAIK. You can follow news about it in this issue.
If you are lucky, you can embed your variable into query for data. Possibility of this will depend on your data source and complexity of current query.
Here are examples for a couple of data sources: Prometheus and SQL type data source (for example MySQL):
If it's rather simple metric query to Prometheus, for example something like
node_systemd_version{env="demo"}
you could convert it to
node_systemd_version{env="demo", env=~".*$query.*"}
or node_systemd_version{env="demo", job=~".*$query.*"}
or node_systemd_version{env="demo", instance=~".*$query.*"}
In case of SQL type data source you could add something like
AND (
column1 like '%${query}%'
OR column2 like '%${query}%'
OR column3 like '%${query}%'
)