<?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 condition in props.conf using mvindex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460940#M130027</link>
    <description>&lt;P&gt;You can setup a &lt;CODE&gt;calculated field&lt;/CODE&gt; with this definition:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;second_user = coalesce(second_user, "Null")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Sep 2019 17:39:24 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-09-18T17:39:24Z</dc:date>
    <item>
      <title>Eval condition in props.conf using mvindex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460936#M130023</link>
      <description>&lt;P&gt;I have a field which contains 2 values for every event as shown below: &lt;/P&gt;

&lt;P&gt;Field Name :- Username&lt;BR /&gt;
Example Values :- A,B&lt;/P&gt;

&lt;P&gt;Now from the above example I have defined 2 extra fields &lt;STRONG&gt;first_user&lt;/STRONG&gt; and &lt;STRONG&gt;second_user&lt;/STRONG&gt; &lt;BR /&gt;
&lt;STRONG&gt;first_user&lt;/STRONG&gt;=A (1st field value from Username)&lt;BR /&gt;
&lt;STRONG&gt;second_user&lt;/STRONG&gt;=B (2nd field value from Username)&lt;/P&gt;

&lt;P&gt;Both the above 2 fields work well as long as the Username field has two values but when the Username has only 1 value like the first field(A) is there and the second field(B) is null. I want to display the Null or empty for second_user field but instead right now it just picking up the A value for second_user field. &lt;/P&gt;

&lt;P&gt;In order to resolve this, I'm trying to work on a Regex on props.conf by using some if condition and a mvindex command to give the logic something like if the B is null. I want to display null. &lt;/P&gt;

&lt;P&gt;Any help on providing the format for regex would be great. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460936#M130023</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-30T01:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Eval condition in props.conf using mvindex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460937#M130024</link>
      <description>&lt;P&gt;See if something like this works for you&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/XdkInV/1"&gt;https://regex101.com/r/XdkInV/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 00:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460937#M130024</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-08-24T00:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Eval condition in props.conf using mvindex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460938#M130025</link>
      <description>&lt;P&gt;thanks @somesoni2 regex works good. Now how can I apply that regex on props.conf what is the syntax for that. &lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 19:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460938#M130025</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2019-08-28T19:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Eval condition in props.conf using mvindex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460939#M130026</link>
      <description>&lt;P&gt;If the original field (which has two Username values) is already extract, then follow solution from this :&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/322843/extract-fields-from-an-already-extracted-field.html"&gt;https://answers.splunk.com/answers/322843/extract-fields-from-an-already-extracted-field.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If not, then you can setup based on _raw data but would need to adjust the regex then setup like this&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Exampleconfigurationswithprops.conf"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Exampleconfigurationswithprops.conf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Exampleconfigurationsusingfieldtransforms"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Exampleconfigurationsusingfieldtransforms&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 21:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460939#M130026</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-08-28T21:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Eval condition in props.conf using mvindex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460940#M130027</link>
      <description>&lt;P&gt;You can setup a &lt;CODE&gt;calculated field&lt;/CODE&gt; with this definition:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;second_user = coalesce(second_user, "Null")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2019 17:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-condition-in-props-conf-using-mvindex/m-p/460940#M130027</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-09-18T17:39:24Z</dc:date>
    </item>
  </channel>
</rss>

