<?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: Case with Tag's in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55701#M13598</link>
    <description>&lt;P&gt;The quotes are only supposed to be around the VALUE, not the field name as well. So &lt;CODE&gt;tag == "audit"&lt;/CODE&gt;. Otherwise you're just giving &lt;CODE&gt;case&lt;/CODE&gt; a string and don't tell it what to actually do with it.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2013 06:59:51 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2013-09-06T06:59:51Z</dc:date>
    <item>
      <title>Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55694#M13591</link>
      <description>&lt;P&gt;I am trying to use Case to rename taged events like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;tag=audit OR tag=cleared "" | eval Event=case( tag == audit, "Logging Stoped", tag == cleared, "Logs Cleared" )&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The case statement is not working not finding any events and the Event field is not generated.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 18:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55694#M13591</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-05T18:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55695#M13592</link>
      <description>&lt;P&gt;Without the quotes, you're asking &lt;CODE&gt;eval&lt;/CODE&gt; to compare the value of the field &lt;CODE&gt;tag&lt;/CODE&gt; to the value of the field &lt;CODE&gt;audit&lt;/CODE&gt; and &lt;CODE&gt;cleared&lt;/CODE&gt;, respectively. I'm guessing you'd want quotes around those?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 19:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55695#M13592</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-05T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55696#M13593</link>
      <description>&lt;P&gt;I tried with the added quotes and the case function throws a syntax error.&lt;/P&gt;

&lt;P&gt;The example on Splunk docs is like this;&lt;BR /&gt;
&lt;CODE&gt;... | eval description=case(error == 404, "Not found", error == 500, "Internal Server Error", error == 200, "OK")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 19:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55696#M13593</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-05T19:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55697#M13594</link>
      <description>&lt;P&gt;Yup. So what does it look like in your case? What error are you getting?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 19:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55697#M13594</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-05T19:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55698#M13595</link>
      <description>&lt;P&gt;I do not get any errors the search runs as expected and generates events as expected but the eval command does not generate the field named "Event" using the case function.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 20:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55698#M13595</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-05T20:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55699#M13596</link>
      <description>&lt;P&gt;Yes, you're using it without quotes. That is wrong. You just said you got a syntax error with quotes. What was it?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 20:59:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55699#M13596</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-05T20:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55700#M13597</link>
      <description>&lt;P&gt;Oh Sorry i misunderstood the question.&lt;/P&gt;

&lt;P&gt;WhenI do this &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;tag=audit OR tag=cleared "" | eval Event=case( "tag == audit", "Logging Stoped", "tag == cleared", "Logs Cleared" )&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I get this error &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Error in 'eval' command: The arguments to the 'case' function are invalid&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 21:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55700#M13597</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-05T21:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55701#M13598</link>
      <description>&lt;P&gt;The quotes are only supposed to be around the VALUE, not the field name as well. So &lt;CODE&gt;tag == "audit"&lt;/CODE&gt;. Otherwise you're just giving &lt;CODE&gt;case&lt;/CODE&gt; a string and don't tell it what to actually do with it.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 06:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55701#M13598</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-06T06:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Case with Tag's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55702#M13599</link>
      <description>&lt;P&gt;Thanks Ayn &lt;/P&gt;

&lt;P&gt;That make sense, about the quotes I mean.  So I tried this;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;tag=audit OR tag=cleared ""&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;This search generated events with;&lt;BR /&gt;
tag::eventtype, value=audit&lt;BR /&gt;
tag::eventtype, value=cleared&lt;/P&gt;

&lt;P&gt;but when I do this;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;tag=audit OR tag=cleared "" | stats count by tag&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I get zero results. I guess I am confused about tag relationships.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2013 14:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Case-with-Tag-s/m-p/55702#M13599</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-09-09T14:29:54Z</dc:date>
    </item>
  </channel>
</rss>

