Variable Injection

What are Variables?

Variables are values that can be injected in any of the custom queries that you are adding within a step. Currently we only support string type variables.

$var_name = 'error_text'
  • Even if you enter the string without quotes, by default your variable will be stored within single quotes.

Using variables in a query:

To use a variable within a query write $var_name wherever you want to add the variable:

fields @timestamp, @message
| filter kubernetes.namespace_name like $var_name 
| limit 10
SELECT count(*) as total_incidents
FROM ontime
WHERE DepDelay>$var_name
ORDER BY count(*) DESC;
select * from table_name where value = $var_name
SELECT rate(count(newrelic.goldenmetrics.apm.application.throughput), 1 MINUTES) 
AS 'Throughput' 
FROM Metric 
WHERE entity.guid in ($var_name) 
LIMIT MAX TIMESERIES