<?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: Execute/ignore block of code based on token values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643644#M222965</link>
    <description>&lt;P&gt;SPL is not a procedural language.&lt;/P&gt;&lt;P&gt;Depending on you actual usecase, you could set a token value based on whether the check box is checked which includes all the SPL you want included in your search, and then just use this token in the search.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 14:18:34 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-05-17T14:18:34Z</dc:date>
    <item>
      <title>How to execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643633#M222962</link>
      <description>&lt;P&gt;I have a union [] command that I want to execute only if a check box is checked, how can I manage this? SPL2 branch doesn't work on my dashboard for some reason and the eval if else only works for assigning a value to a var, what options do I have now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| search | if value = 'so and so' execute union [sql]&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 08:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643633#M222962</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-24T08:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643644#M222965</link>
      <description>&lt;P&gt;SPL is not a procedural language.&lt;/P&gt;&lt;P&gt;Depending on you actual usecase, you could set a token value based on whether the check box is checked which includes all the SPL you want included in your search, and then just use this token in the search.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643644#M222965</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643648#M222968</link>
      <description>&lt;P&gt;I am doing that right now, and it's messy, very messy because my block of code is large and has many other tokens in it. It's just a big mess.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643648#M222968</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-17T14:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643649#M222969</link>
      <description>&lt;P&gt;Another possibility (untested) is that you set the value of the checkbox token to 3 backticks (denoting start/end of comment) and place the token at the beginning and end of your union commands&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643649#M222969</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643651#M222970</link>
      <description>&lt;P&gt;Another possibility is that you use appendpipe with a where clause to evaluate whether the token is set at the beginning and the rest of the SPL following the where clause&lt;/P&gt;&lt;P&gt;More than one way to skin a cat!&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:33:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643651#M222970</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643652#M222971</link>
      <description>&lt;P&gt;can you give me an example in code, this seems interesting&lt;BR /&gt;this method of skinning a cat seems interesting&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643652#M222971</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-17T14:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643655#M222973</link>
      <description>&lt;P&gt;You want to add a change handler to the checkbox so that if the box is not checked, it sets the token to "```" and if it is checked, it sets it to ""&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search | appendpipe [$checkboxtoken$ | spl for additional events $checkboxtoken$]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 14:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643655#M222973</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643656#M222974</link>
      <description>&lt;LI-CODE lang="markup"&gt;| search | appendpipe [| where $token$="value meaning execute SPL" | spl to execute]&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 May 2023 14:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643656#M222974</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643657#M222975</link>
      <description>&lt;P class="lia-align-left"&gt;Is&amp;nbsp;&lt;SPAN&gt;``` some sort of commenting?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643657#M222975</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-17T14:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643659#M222977</link>
      <description>&lt;P&gt;Yes, as of Splunk version 8.something I think&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:46:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643659#M222977</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-17T14:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643660#M222978</link>
      <description>&lt;P&gt;I'm gonna try these and get back to you sir, May the Splunk God be with you!&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 14:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/643660#M222978</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-17T14:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Execute/ignore block of code based on token values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/644428#M223197</link>
      <description>&lt;P&gt;Hi, I found another solution to my issue that doesn't require me to have the 2nd block of code in the first place. But if I did go ahead with that block I'd have chosen this method. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 08:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-execute-ignore-block-of-code-based-on-token-values/m-p/644428#M223197</guid>
      <dc:creator>jonvijay1993</dc:creator>
      <dc:date>2023-05-24T08:46:11Z</dc:date>
    </item>
  </channel>
</rss>

