<?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 to create a new field using eval by eventtype? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393022#M114333</link>
    <description>&lt;P&gt;Weird. It seems like the eval for action just refuses to work, I even tried changing the action to evalAction, and manually filtering mod_action to be N.A for the auth events, but while the mod_action for auth events became N.A, when I got evalAction to check if mod_action is N.A and return the outcome field if it is and mod_action field if it is not, the if statement keeps evaluating to false and mod_action values are displayed for evalAction. Guess it’s just some issue’s with Splunk so I’ll try again tmr&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:47:58 GMT</pubDate>
    <dc:creator>jmteo</dc:creator>
    <dc:date>2020-09-29T20:47:58Z</dc:date>
    <item>
      <title>How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393016#M114327</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I am trying to create an evaluated field, action, that will contain different values from different fields based on whether the eventtype is change for mapping to the change and authentication CIM models action field respectively. After some research and searching around, I still am stuck at it.&lt;BR /&gt;
My current eval statement is:&lt;BR /&gt;
eval action = if('tag::eventtype'!="change", outcome, mod_action)&lt;BR /&gt;
Examples of values: outcome=&amp;gt; success, failure   mod_action=&amp;gt; modified, deleted&lt;/P&gt;

&lt;P&gt;Could someone kindly advise me as to what I am doing wrong here? Why is it that when I try this splunk always evaluates action to either outcome or mod_action, and not either of them depending on the eventtype? Thanks and have a pleasant day ahead &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393016#M114327</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2020-09-29T20:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393017#M114328</link>
      <description>&lt;P&gt;Do you mean  to say, you get the result as literal value 'outcome' and 'mod_action' instead of the actual "values" or regardless of condition, you get both values?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 07:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393017#M114328</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-06T07:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393018#M114329</link>
      <description>&lt;P&gt;For the current eval statement, the action field always evaluates to mod_action&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 08:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393018#M114329</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2018-08-06T08:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393019#M114330</link>
      <description>&lt;P&gt;That sounds to me like there is something wrong with evaluating the &lt;CODE&gt;'tag::eventtype'!="change"&lt;/CODE&gt;. I'm wondering if it is even possible to evaluate tags like that in eval statements?&lt;/P&gt;

&lt;P&gt;Have you tried simply evaluating &lt;CODE&gt;eventtype=foo&lt;/CODE&gt;, rather than through the tag? Otherwise, try and find some other knowledge to make the choice, rather than based on the eventtype.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 08:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393019#M114330</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-08-06T08:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393020#M114331</link>
      <description>&lt;P&gt;Hi Guys, &lt;/P&gt;

&lt;P&gt;I have authentication events tagged as authentication, and change events tagged with change. What would be a possible way to do an eval like what I asked above, without using the tags, if the events contains no clear indication as to whether they are change or authentication events? I have tried with eventtypes as suggested above but even that does not work as action keeps being mod_action&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 09:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393020#M114331</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2018-08-06T09:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393021#M114332</link>
      <description>&lt;P&gt;Does mod_action contain any value for authentication events? If not, you could simply do:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval action = coalesce(mod_action,outcome)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Otherwise: how have you defined your eventtype? That must be on some criteria, right? Should be possible to use the same to construct the action field.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 09:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393021#M114332</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-08-06T09:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393022#M114333</link>
      <description>&lt;P&gt;Weird. It seems like the eval for action just refuses to work, I even tried changing the action to evalAction, and manually filtering mod_action to be N.A for the auth events, but while the mod_action for auth events became N.A, when I got evalAction to check if mod_action is N.A and return the outcome field if it is and mod_action field if it is not, the if statement keeps evaluating to false and mod_action values are displayed for evalAction. Guess it’s just some issue’s with Splunk so I’ll try again tmr&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393022#M114333</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2020-09-29T20:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393023#M114334</link>
      <description>&lt;P&gt;Are you doing this in props.conf or in the search bar?&lt;/P&gt;

&lt;P&gt;If in props.conf, it should be &lt;CODE&gt;EVAL-action = ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 12:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393023#M114334</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-08-06T12:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393024#M114335</link>
      <description>&lt;P&gt;I am doing this through the "evaluated fields" section under fields and adding an eval statement for the splunk TA that I am developing. I have looked at the props.conf present in the local folder, the eval statement is as I have added in the splunk UI&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 14:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393024#M114335</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2018-08-06T14:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393025#M114336</link>
      <description>&lt;P&gt;In props.conf it should read &lt;CODE&gt;EVAL-action = ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 14:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393025#M114336</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-08-06T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new field using eval by eventtype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393026#M114337</link>
      <description>&lt;P&gt;Yeap, that's how it looked like in my local props.conf file for my add-on before I changed it to try something else, which is why all the more I am puzzled that no matter how I try today, the evaluation is not working properly. I will try again tomorrow to see how it goes, it might just be a case of my splunk instance lagging. Thanks for your help so far &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 15:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-field-using-eval-by-eventtype/m-p/393026#M114337</guid>
      <dc:creator>jmteo</dc:creator>
      <dc:date>2018-08-06T15:05:13Z</dc:date>
    </item>
  </channel>
</rss>

