<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How and when to use $abc$ to tell Splunk that abc is a field name? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228213#M14135</link>
    <description>&lt;P&gt;Are macros what you are looking for?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;macros.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_macro(2)]
args = arg1, arg2
definition = search index=$arg2$ sourcetype=$arg$ ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since you can call macros in macros this may look as if $abc$ was used as some kind of fieldname.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Usesearchmacros"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Usesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2015 15:59:48 GMT</pubDate>
    <dc:creator>Sebastian2</dc:creator>
    <dc:date>2015-11-18T15:59:48Z</dc:date>
    <item>
      <title>How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228207#M14129</link>
      <description>&lt;P&gt;Somewhere I read about using &lt;CODE&gt;$abc$&lt;/CODE&gt;, to tell Splunk that &lt;STRONG&gt;abc&lt;/STRONG&gt; is a fieldname?&lt;BR /&gt;
I can't find explanations in the docs on when and how it can be used. Can someone provide a link regarding this topic?&lt;/P&gt;

&lt;P&gt;Cheers&lt;BR /&gt;
Heinz&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 13:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228207#M14129</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2015-11-16T13:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228208#M14130</link>
      <description>&lt;P&gt;You can define and use Token in dashbaords. Is that what you're thinking of? What are you trying to do?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 13:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228208#M14130</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-16T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228209#M14131</link>
      <description>&lt;P&gt;Hi Heinz,&lt;/P&gt;

&lt;P&gt;If you want to add any input on your dashboard(drop-down menu, check-box,multi select,etc...) , there is a section called "token".&lt;/P&gt;

&lt;P&gt;Let's you insert there as abc into token section means you can use this variable as $abc$ in your splunk serach query. Once this inout selected by user(example dropdown menu), your search directly take this variable fr searching.&lt;/P&gt;

&lt;P&gt;There is also detail information from the link below.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Viz/tokens&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Gokhan&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 13:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228209#M14131</guid>
      <dc:creator>gyarici</dc:creator>
      <dc:date>2015-11-16T13:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228210#M14132</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I know the usage for form inputs in dashboards. But I think it can be used in a saved search as well, here is an example with a field called clicks/user&lt;/P&gt;

&lt;P&gt;These two options do not work&lt;/P&gt;

&lt;P&gt;| fieldformat clicks/user=tostring(clicks/user, "commas")&lt;/P&gt;

&lt;P&gt;| fieldformat clicks/user=tostring("clicks/user", "commas")&lt;/P&gt;

&lt;P&gt;But when I use &lt;BR /&gt;
| fieldformat clicks/user=tostring(&lt;STRONG&gt;$&lt;/STRONG&gt;clicks/user*&lt;EM&gt;$&lt;/EM&gt;*, "commas")&lt;/P&gt;

&lt;P&gt;it works fine&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228210#M14132</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2020-09-29T07:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228211#M14133</link>
      <description>&lt;P&gt;@HeinzWaescher, in this scenario, it operates as the &lt;CODE&gt;'&lt;/CODE&gt; single quotes needed to escape punctuation characters or non [a-z] stuff inside of a field name. So, the normal version of your search would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fieldformat clicks/user=tostring('clicks/user', "commas")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Within an eval statement, double quotes &lt;CODE&gt;"&lt;/CODE&gt; are always used to specify &lt;STRONG&gt;string literals&lt;/STRONG&gt; whereas the single quote &lt;CODE&gt;'&lt;/CODE&gt; is used to help specify fields. I would suggest keeping your field names &lt;STRONG&gt;free&lt;/STRONG&gt; of punctuation and strange characters, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval clicks_per_user = clicks / user
| fieldformat clicks_per_user = tostring(clicks_per_user, "commas")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2015 17:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228211#M14133</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-11-16T17:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228212#M14134</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 15:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228212#M14134</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2015-11-18T15:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How and when to use $abc$ to tell Splunk that abc is a field name?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228213#M14135</link>
      <description>&lt;P&gt;Are macros what you are looking for?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;macros.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_macro(2)]
args = arg1, arg2
definition = search index=$arg2$ sourcetype=$arg$ ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since you can call macros in macros this may look as if $abc$ was used as some kind of fieldname.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Usesearchmacros"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Usesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 15:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-and-when-to-use-abc-to-tell-Splunk-that-abc-is-a-field-name/m-p/228213#M14135</guid>
      <dc:creator>Sebastian2</dc:creator>
      <dc:date>2015-11-18T15:59:48Z</dc:date>
    </item>
  </channel>
</rss>

