<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Variable_Syntax</id>
	<title>Variable Syntax - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Variable_Syntax"/>
	<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Variable_Syntax&amp;action=history"/>
	<updated>2026-05-25T11:53:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://docs.foji.io/index.php?title=Variable_Syntax&amp;diff=960&amp;oldid=prev</id>
		<title>Chris.Hansen: Created page with &quot;Panel titles and metric queries can refer to variables using two different syntaxes:  * &#039;&#039;&#039;$varname&#039;&#039;&#039; This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.  Example: apps.frontend.$server.requests.count * &#039;&#039;&#039;${var_name}&#039;&#039;&#039; Use this syntax when you want to interpolate a variable in the middle of an expression. * &#039;&#039;&#039;${var_name:&lt;format&gt;}&#039;&#039;&#039; This format gives you more control over how FojiSoft interpolates values. Refer to Advance...&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Variable_Syntax&amp;diff=960&amp;oldid=prev"/>
		<updated>2024-01-03T19:50:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Panel titles and metric queries can refer to variables using two different syntaxes:  * &amp;#039;&amp;#039;&amp;#039;$varname&amp;#039;&amp;#039;&amp;#039; This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.  Example: apps.frontend.$server.requests.count * &amp;#039;&amp;#039;&amp;#039;${var_name}&amp;#039;&amp;#039;&amp;#039; Use this syntax when you want to interpolate a variable in the middle of an expression. * &amp;#039;&amp;#039;&amp;#039;${var_name:&amp;lt;format&amp;gt;}&amp;#039;&amp;#039;&amp;#039; This format gives you more control over how FojiSoft interpolates values. Refer to Advance...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Panel titles and metric queries can refer to variables using two different syntaxes:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;$varname&amp;#039;&amp;#039;&amp;#039; This syntax is easy to read, but it does not allow you to use a variable in the middle of a word.  Example: apps.frontend.$server.requests.count&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;${var_name}&amp;#039;&amp;#039;&amp;#039; Use this syntax when you want to interpolate a variable in the middle of an expression.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;${var_name:&amp;lt;format&amp;gt;}&amp;#039;&amp;#039;&amp;#039; This format gives you more control over how FojiSoft interpolates values. Refer to Advanced variable format options for more detail on all the formatting types.&lt;br /&gt;
&lt;br /&gt;
Before queries are sent to your data source the query is &amp;#039;&amp;#039;interpolated&amp;#039;&amp;#039;, meaning the variable is replaced with its current value. During interpolation, the variable value might be &amp;#039;&amp;#039;escaped&amp;#039;&amp;#039; in order to conform to the syntax of the query language and where it is used. For example, a variable used in a regex expression will be regex escaped. Read the data source specific documentation topic for details on value escaping during interpolation.&lt;br /&gt;
&lt;br /&gt;
For advanced syntax to override data source default formatting, refer to Advanced variable format options.&lt;br /&gt;
&lt;br /&gt;
== Advanced variable format options ==&lt;br /&gt;
The formatting of the variable interpolation depends on the data source, but there are some situations where you might want to change the default formatting.&lt;br /&gt;
&lt;br /&gt;
For example, the default for the MySql data source is to join multiple values as comma-separated with quotes: &amp;#039;server01&amp;#039;,&amp;#039;server02&amp;#039;. In some cases, you might want to have a comma-separated string without quotes: server01,server02. You can make that happen with advanced variable formatting options listed below.&lt;br /&gt;
&lt;br /&gt;
=== General syntax ===&lt;br /&gt;
Syntax: ${var_name:option}&lt;br /&gt;
&lt;br /&gt;
If any invalid formatting option is specified, then glob is the default/fallback option.&lt;br /&gt;
&lt;br /&gt;
An alternative syntax (that might be deprecated in the future) is &amp;lt;nowiki&amp;gt;[[var_name:option]]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== CSV ===&lt;br /&gt;
Formats variables with multiple values as a comma-separated string.&lt;br /&gt;
[[File:Visualize variable syntax csv.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Distributed - OpenTSDB ===&lt;br /&gt;
Formats variables with multiple values in custom format for OpenTSDB.&lt;br /&gt;
[[File:Visualize variable syntax opentsdb.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Doublequote ===&lt;br /&gt;
Formats single-and multi-valued variables into a comma-separated string, escapes &amp;quot; in each value by \&amp;quot; and quotes each value with &amp;quot;.&lt;br /&gt;
[[File:Visualize variable syntax double quote.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== JSON ===&lt;br /&gt;
Formats variables with multiple values as a comma-separated string.&lt;br /&gt;
[[File:Visualize variable syntax json.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Percentencode ===&lt;br /&gt;
Formats single and multi valued variables for use in URL parameters.&lt;br /&gt;
[[File:Visualize variable syntax percentencode.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Pipe ===&lt;br /&gt;
Formats variables with multiple values into a pipe-separated string.&lt;br /&gt;
[[File:Visualize variable syntax pipe.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Raw ===&lt;br /&gt;
Turns off datasource-specific formatting, such as single quotes in an SQL query.&lt;br /&gt;
[[File:Visualize variable syntax raw.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Regex ===&lt;br /&gt;
Formats variables with multiple values into a regex string.&lt;br /&gt;
[[File:Visualize variable syntax regex.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Singlequote ===&lt;br /&gt;
Formats single-and multi-valued variables into a comma-separated string, escapes &amp;#039; in each value by \&amp;#039; and quotes each value with &amp;#039;.&lt;br /&gt;
[[File:Visualize variable syntax singlequote.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Sqlstring ===&lt;br /&gt;
Formats single-and multi-valued variables into a comma-separated string, escapes &amp;#039; in each value by &amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt; and quotes each value with &amp;#039;.&lt;br /&gt;
[[File:Visualize variable syntax sqlstring.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Text ===&lt;br /&gt;
Formats single-and multi-valued variables into their text representation. For a single variable it will just return the text representation. For multi-valued variables it will return the text representation combined with +.&lt;br /&gt;
[[File:Visualize variable syntax text.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Query parameters ===&lt;br /&gt;
Formats single-and multi-valued variables into their query parameter representation. Example: var-foo=value1&amp;amp;var-foo=value2&lt;br /&gt;
[[File:Visualize variable syntax query.png|center|frameless|600x600px]]&lt;br /&gt;
[[Category:Visualize]]&lt;/div&gt;</summary>
		<author><name>Chris.Hansen</name></author>
	</entry>
</feed>