Skip to content

Question on Using Text Pattern to Filter Data #63

Open
@Masahiroshi

Description

@Masahiroshi

I've followed your tutorial on using the text pattern function to filter on specific values as well as using grafana variables.
I was wondering if the text pattern had the ability to filter across multiple parameters or is there a specific syntax to pass it multiple parameters?

For example,
I got an OR function to work by entering the following examples:
metric_type = discrete | metric_aggregate = mean

I get the equivalent of metric_type equals 'discrete' OR metric_aggregate equals 'mean'

And if I used a set of variables:
metric_type = ${metric_type:regex} | metric_aggregate = ${metric_aggregate:regex}

I get the equivalent of metric_type equals any values in variable $metric_type OR metric_aggregate equals any values in variable $metric_aggregate

But now I am looking for the ability to pass an AND function through:

Basically the same scenario stated above but with AND as the operator instead of OR.
The variable scenario is what I'm trying to accomplish:

metric_type = ${metric_type:regex} & metric_aggregate = ${metric_aggregate:regex}

I want the equivalent of metric_type equals any values in variable $metric_type and metric_aggregate equals any values in variable $metric_aggregate

I am not very fluent in regex so there may be a syntax that I am unfamiliar with that will satisfy my case.
But, I was wondering if the Text Pattern function had the ability to resolve multiple parameters by separating the statement with a specific character or if you could point me in the direction of a specific regex syntax that would represent the equivalent of an AND operator.

Metadata

Metadata

Labels

questionFurther information is requested

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions