<?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: Field Calculation not working in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348349#M63951</link>
    <description>&lt;P&gt;Is &lt;CODE&gt;rec_type&lt;/CODE&gt; numeric? Because, you're comparing it to the string &lt;CODE&gt;"400"&lt;/CODE&gt;. Remove the quotes and you should be fine. To be extra sure, you could use &lt;CODE&gt;tonumber()&lt;/CODE&gt; to convert.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if(rec_type=400, "network", null)
OR if that doesn't work:
if(tonumber(rec_type)=400 , "network", null)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Dec 2017 15:54:25 GMT</pubDate>
    <dc:creator>echalex</dc:creator>
    <dc:date>2017-12-18T15:54:25Z</dc:date>
    <item>
      <title>Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348346#M63948</link>
      <description>&lt;P&gt;What I'm trying to do is create a field named ids_type and make it equal to network. (ids_type=network)&lt;/P&gt;

&lt;P&gt;I'm trying to add a new field to a sourcetype.  The name of the field is ids_type.  I created an eval statement that works when i run a search. But when I save it as a calculated field it doesn't seem to work.  The eval expression is if(rec_type="400","network",null). I have refreshed Splunk, restarted Splunk and changed the permissions of the  field calculation to all apps. But it doesn't seem to be working. what else can I troubleshoot?  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:18:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348346#M63948</guid>
      <dc:creator>mr_t2083</dc:creator>
      <dc:date>2020-09-29T17:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348347#M63949</link>
      <description>&lt;P&gt;Does the rec_type field exist?  What are the permissions for it?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348347#M63949</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-12-18T15:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348348#M63950</link>
      <description>&lt;P&gt;Yes the rec_type field does exist it.  I have tried several eval statement such as eval ids_type="network" and that still didn't work.  Not sure what I'm doing wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348348#M63950</guid>
      <dc:creator>mr_t2083</dc:creator>
      <dc:date>2020-09-29T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348349#M63951</link>
      <description>&lt;P&gt;Is &lt;CODE&gt;rec_type&lt;/CODE&gt; numeric? Because, you're comparing it to the string &lt;CODE&gt;"400"&lt;/CODE&gt;. Remove the quotes and you should be fine. To be extra sure, you could use &lt;CODE&gt;tonumber()&lt;/CODE&gt; to convert.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if(rec_type=400, "network", null)
OR if that doesn't work:
if(tonumber(rec_type)=400 , "network", null)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348349#M63951</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2017-12-18T15:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348350#M63952</link>
      <description>&lt;P&gt;ha! I was about to suggest that too, but i refreshed the page and you beat me to it!&lt;/P&gt;

&lt;P&gt;Its also worth checking that your sourcetype is set correctly, the result of the calculated field should look like this is props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype_name]
EVAL-ids_type = if(rec_type=400, "network", null)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348350#M63952</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-18T16:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348351#M63953</link>
      <description>&lt;P&gt;I'm not sure if it makes a difference, but try to replace null with null().&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:13:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348351#M63953</guid>
      <dc:creator>Yunagi</dc:creator>
      <dc:date>2017-12-18T16:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculation not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348352#M63954</link>
      <description>&lt;P&gt;If anyone is having the same problem with the TA-eStreamer add on, the field is supposed to be defined using a built-in lookup to sources.csv.  In the lookup file the source is defined as estreamer whereas the encore app is now has a source of encore.  To fix the problem updated the sources.csv lookup file and add another line :&lt;/P&gt;

&lt;P&gt;source,vendor,product,ids_type&lt;BR /&gt;
eStreamer,Cisco,Sourcefire,network&lt;BR /&gt;
encore,Cisco,Firepower,network&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Field-Calculation-not-working/m-p/348352#M63954</guid>
      <dc:creator>sebastianszykie</dc:creator>
      <dc:date>2018-06-08T20:27:09Z</dc:date>
    </item>
  </channel>
</rss>

