<?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: eval function splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84432#M21534</link>
    <description>&lt;P&gt;Hard to say without data, but I think you might be needing fillnull. I think that $mysearch needs to return everything that might be needed, so try putting &lt;CODE&gt;fillnull value=NULL a b c d p q r s&lt;/CODE&gt; before the evals?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jan 2013 23:14:12 GMT</pubDate>
    <dc:creator>jcoates_splunk</dc:creator>
    <dc:date>2013-01-10T23:14:12Z</dc:date>
    <item>
      <title>eval function splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84431#M21533</link>
      <description>&lt;P&gt;In my search I need functionality like &lt;BR /&gt;
My search...| if eventid=1 then "table a,b,c",if eventid=2 then "table c,d",if eventid =3 then "table p,q,r,s"&lt;BR /&gt;
I tried eval case..but I am getting syntax error or it is not giving required output.&lt;BR /&gt;
Please help.&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84431#M21533</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2013-01-10T21:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: eval function splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84432#M21534</link>
      <description>&lt;P&gt;Hard to say without data, but I think you might be needing fillnull. I think that $mysearch needs to return everything that might be needed, so try putting &lt;CODE&gt;fillnull value=NULL a b c d p q r s&lt;/CODE&gt; before the evals?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 23:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84432#M21534</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2013-01-10T23:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: eval function splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84433#M21535</link>
      <description>&lt;P&gt;The results of &lt;CODE&gt;if&lt;/CODE&gt; statements and &lt;CODE&gt;eval&lt;/CODE&gt; statements cannot be commands. So, to take &lt;A href="http://splunk-base.splunk.com/users/9610/jcoates_splunk"&gt;jcoates&lt;/A&gt; answer a step further:&lt;/P&gt;

&lt;P&gt;Assume that you have the fields &lt;CODE&gt;a b c d p q r s&lt;/CODE&gt;. Then, do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| table eventid a b c d p q r s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't think that you actually need the &lt;CODE&gt;fillnull&lt;/CODE&gt;, although it shouldn't hurt.&lt;BR /&gt;&lt;BR /&gt;
Of course, this table will have field headers that may be empty. It's a little complicated, but you could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval list = case(eventid=="1", a + "\t" + b + "\t" + c,
                          eventid=="2", c + "\t" + d
                          eventid=="3", p + "\t" + q + "\t" + r+ "\t" + s)
| table list
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW, I am hoping that "\t" will translate to the tab character. I haven't actually tried that part.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 23:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84433#M21535</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-01-10T23:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: eval function splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84434#M21536</link>
      <description>&lt;P&gt;Thankyou So much.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2013 00:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-function-splunk/m-p/84434#M21536</guid>
      <dc:creator>disha</dc:creator>
      <dc:date>2013-01-15T00:30:53Z</dc:date>
    </item>
  </channel>
</rss>

