<?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 How to set variable based on token value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-variable-based-on-token-value/m-p/590873#M205699</link>
    <description>&lt;P&gt;I'm looking to set a variable (customerLabel) depending on whether the user selects "framework" or "team" from a dropdown list. The token set with the dropdown is $grouping-name$. Where am I going wrong as customerLabel is not being set with a value at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've included a snippet of the code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval teamCustomerLabel=case(issueLabel="customer1", "Customer 1", issueLabel="customer2", "Customer 2", issueLabel="customer3", "Customer 3", issueLabel="customer4", "Customer 4", issueLabel="customer5", "Customer 5", issueLabel="customer6", "Customer 6")

| eval frameworkCustomerLabel=case(issueLabel="customer1", "Group 1", issueLabel="customer2", "Group 1", issueLabel="customer3", "Group 2", issueLabel="customer4", "Group 2", issueLabel="customer5", "Group 3", issueLabel="customer6", "Group 3")

| eval customerLabel=case("$grouping-name$"=="framework", frameworkCustomerLabel, "$grouping-name$"=="team", teamCustomerLabel)

| chart count(key) as "Created" over _time by customerLabel where top 50&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 18:56:55 GMT</pubDate>
    <dc:creator>anthonyb90</dc:creator>
    <dc:date>2022-03-25T18:56:55Z</dc:date>
    <item>
      <title>How to set variable based on token value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-variable-based-on-token-value/m-p/590873#M205699</link>
      <description>&lt;P&gt;I'm looking to set a variable (customerLabel) depending on whether the user selects "framework" or "team" from a dropdown list. The token set with the dropdown is $grouping-name$. Where am I going wrong as customerLabel is not being set with a value at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've included a snippet of the code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval teamCustomerLabel=case(issueLabel="customer1", "Customer 1", issueLabel="customer2", "Customer 2", issueLabel="customer3", "Customer 3", issueLabel="customer4", "Customer 4", issueLabel="customer5", "Customer 5", issueLabel="customer6", "Customer 6")

| eval frameworkCustomerLabel=case(issueLabel="customer1", "Group 1", issueLabel="customer2", "Group 1", issueLabel="customer3", "Group 2", issueLabel="customer4", "Group 2", issueLabel="customer5", "Group 3", issueLabel="customer6", "Group 3")

| eval customerLabel=case("$grouping-name$"=="framework", frameworkCustomerLabel, "$grouping-name$"=="team", teamCustomerLabel)

| chart count(key) as "Created" over _time by customerLabel where top 50&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 18:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-variable-based-on-token-value/m-p/590873#M205699</guid>
      <dc:creator>anthonyb90</dc:creator>
      <dc:date>2022-03-25T18:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting variable based on token value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-set-variable-based-on-token-value/m-p/590904#M205710</link>
      <description>&lt;P&gt;Set the values in your dropdown&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;option value="frameworkCustomerLabel"&amp;gt;framework&amp;lt;/option&amp;gt;
&amp;lt;option value="teamCustomerLabel"&amp;gt;team&amp;lt;/option&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;and use the token in the search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval teamCustomerLabel=case(issueLabel="customer1", "Customer 1", issueLabel="customer2", "Customer 2", issueLabel="customer3", "Customer 3", issueLabel="customer4", "Customer 4", issueLabel="customer5", "Customer 5", issueLabel="customer6", "Customer 6")

| eval frameworkCustomerLabel=case(issueLabel="customer1", "Group 1", issueLabel="customer2", "Group 1", issueLabel="customer3", "Group 2", issueLabel="customer4", "Group 2", issueLabel="customer5", "Group 3", issueLabel="customer6", "Group 3")

| chart count(key) as "Created" over _time by $grouping-name$ where top 50&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 16:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-set-variable-based-on-token-value/m-p/590904#M205710</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-25T16:58:48Z</dc:date>
    </item>
  </channel>
</rss>

