<?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 Can I use a IF\ElSE in a props.conf? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Can-I-use-a-IF-ElSE-in-a-props-conf/m-p/303686#M5624</link>
    <description>&lt;P&gt;Can I use IF\ELSE in a PROPS.conf? What does the syntax look like.&lt;/P&gt;

&lt;P&gt;basically we want to do a if this eventid then do this else do this.&lt;/P&gt;

&lt;P&gt;can I nest them.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2018 14:02:16 GMT</pubDate>
    <dc:creator>pfabrizi</dc:creator>
    <dc:date>2018-01-12T14:02:16Z</dc:date>
    <item>
      <title>Can I use a IF\ElSE in a props.conf?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-I-use-a-IF-ElSE-in-a-props-conf/m-p/303686#M5624</link>
      <description>&lt;P&gt;Can I use IF\ELSE in a PROPS.conf? What does the syntax look like.&lt;/P&gt;

&lt;P&gt;basically we want to do a if this eventid then do this else do this.&lt;/P&gt;

&lt;P&gt;can I nest them.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-I-use-a-IF-ElSE-in-a-props-conf/m-p/303686#M5624</guid>
      <dc:creator>pfabrizi</dc:creator>
      <dc:date>2018-01-12T14:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a IF\ElSE in a props.conf?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-I-use-a-IF-ElSE-in-a-props-conf/m-p/303687#M5625</link>
      <description>&lt;P&gt;hey yes you can do!!&lt;/P&gt;

&lt;P&gt;Calculated fields with props.conf example&lt;/P&gt;

&lt;P&gt;This example examines earthquake data and classifies quakes by their depth by creating a Description field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=eqs7day-M1.csv | eval Description=case(Depth&amp;lt;=70, "Shallow", Depth&amp;gt;70 AND Depth&amp;lt;=300, "Mid", Depth&amp;gt;300 AND Depth&amp;lt;=700, "Deep") | table Datetime, Region, Depth, Description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Steps&lt;BR /&gt;
Using calculated fields, you could define the eval expression for the Description field in props.conf.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Create the following stanza in props.conf.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;Stanza&amp;gt;&lt;BR /&gt;
Eval-Description = case(Depth&amp;lt;=70, "Shallow", Depth&amp;gt;70 AND Depth&amp;lt;=300, "Mid", Depth&amp;gt;300 AND Depth&amp;lt;=700, "Deep")&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;2 . Rewrite the search as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=eqs7day-M1.csv | table Datetime, Region, Depth, Description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can now search on Description as if it is any other extracted field. Splunk software will find the calculated field key and evaluate it for every event that contains a Depth field. You can also run searches like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=eqs7day-M1.csv Description=Deep
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer this link for more it is the same&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Configurecalculatedfieldswithprops.conf"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Configurecalculatedfieldswithprops.conf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 14:09:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-I-use-a-IF-ElSE-in-a-props-conf/m-p/303687#M5625</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-12T14:09:46Z</dc:date>
    </item>
  </channel>
</rss>

