<?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 returning null value for a looked up field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165275#M46965</link>
    <description>&lt;P&gt;The problem is that MAX_IOPS is NULL and I can't see why it is. &lt;/P&gt;

&lt;P&gt;The value is retrieved via a lookup:&lt;/P&gt;

&lt;P&gt;~props.conf:&lt;BR /&gt;
LOOKUP-ssa-3par-iops = ssa-3par-performance DISKTYPE SPEED OUTPUTNEW MAX_IOPS MAX_MBS&lt;/P&gt;

&lt;P&gt;~transforms.conf: &lt;BR /&gt;
[ssa-3par-performance]&lt;BR /&gt;
filename = ssa_3par_iops.csv&lt;/P&gt;

&lt;P&gt;[root@vspindexlt03 local]# cat ../lookups/ssa_3par_iops.csv&lt;BR /&gt;
DISKTYPE,SPEED,MAX_IOPS,MAX_MBS&lt;BR /&gt;
NL,7,75,30&lt;BR /&gt;
FC,10,150,45&lt;BR /&gt;
FC,15,200,45&lt;/P&gt;

&lt;P&gt;This is working as I see it in the events, but I get a NULL for MAX_IOPS when charting with:&lt;/P&gt;

&lt;P&gt;index=ssa source="dbmon-tail://3Par-System-Reporter/statpd_hires" 3par_array_name=f400xlt01 DISKTYPE=NL SPEED=* PDID=17 OR PDID=18 | eval total_iops=(((d_rcount + d_wcount) * 1000000)/d_now_msec)   | eval read_iops=((d_rcount * 1000000)/d_now_msec)   | eval write_iops=((d_wcount * 1000000)/d_now_msec) | timechart  span=1m max(read_iops) as "Read IOPs", max(write_iops) as "Write IOPs" by PDID | eval maxiops=if(isnull(MAX_IOPS),"75",MAX_IOPS)&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:37:27 GMT</pubDate>
    <dc:creator>ffrig</dc:creator>
    <dc:date>2020-09-28T16:37:27Z</dc:date>
    <item>
      <title>eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165271#M46961</link>
      <description>&lt;P&gt;I have a query which I need to chart with an overlay with a static baseline figure (maxiops) which is retrieved by looking up a couple of fields in a csv file (DISKTYPE and SPEED). This returns MAX_IOPS.&lt;/P&gt;

&lt;P&gt;I'm using 6.1 and thought this would be nice and easy, but it appears that MAX_IOPS is being treated as NULL so I cannot plot the line. If I hardcode maxiops=75 etc it works.&lt;/P&gt;

&lt;P&gt;Any ideas how I can use the MAX_IOPS field for plotting the static line? The value is not dependent on the number of disks (PDID) returned. It's just based on DISKTYPE and SPEED.&lt;/P&gt;

&lt;P&gt;index=ssa source="dbmon-tail://3Par-System-Reporter/statpd_hires" 3par_array_name=f400xlt01 DISKTYPE=NL SPEED=* PDID=17 OR PDID=18 | eval total_iops=(((d_rcount + d_wcount) * 1000000)/d_now_msec)   | eval read_iops=((d_rcount * 1000000)/d_now_msec)   | eval write_iops=((d_wcount * 1000000)/d_now_msec) | timechart  span=1m max(read_iops) as "Read IOPs", max(write_iops) as "Write IOPs" by PDID | eval maxiops=if(isnull(MAX_IOPS),"yes","no")&lt;/P&gt;

&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:37:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165271#M46961</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2020-09-28T16:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165272#M46962</link>
      <description>&lt;P&gt;Hi ffrig,&lt;/P&gt;

&lt;P&gt;I not sure if i understand it completely, but what I see is that you set &lt;CODE&gt;maxiops&lt;/CODE&gt; with the last eval to either yes or no and this cannot be charted in timechart.....&lt;/P&gt;

&lt;P&gt;maybe you should try something like this as last eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval maxiops=if(isnull(MAX_IOPS), "75", MAX_IOPS)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will set maxiops to either the value of MAX_IOPS or if the field is empty to 75. Or this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval myMaxIOPS="75" | eval maxiops=coalesce(MAX_IOPS, myMaxIOPS)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will set a new field first and use in the second eval either MAX_IOPS if it exists or myMaxIOPS.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 11:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165272#M46962</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-15T11:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165273#M46963</link>
      <description>&lt;P&gt;Thanks MuS. I'll try your suggestions.&lt;/P&gt;

&lt;P&gt;The last eval "isnull" part was just to show that it's been set to null. I should have taken that out I suppose!&lt;/P&gt;

&lt;P&gt;I don't understand why MAX_IOPS is NULL though?&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 12:18:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165273#M46963</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2014-05-15T12:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165274#M46964</link>
      <description>&lt;P&gt;so you got a field named MAX_IOPS which contains numeric values?&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 12:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165274#M46964</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-15T12:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165275#M46965</link>
      <description>&lt;P&gt;The problem is that MAX_IOPS is NULL and I can't see why it is. &lt;/P&gt;

&lt;P&gt;The value is retrieved via a lookup:&lt;/P&gt;

&lt;P&gt;~props.conf:&lt;BR /&gt;
LOOKUP-ssa-3par-iops = ssa-3par-performance DISKTYPE SPEED OUTPUTNEW MAX_IOPS MAX_MBS&lt;/P&gt;

&lt;P&gt;~transforms.conf: &lt;BR /&gt;
[ssa-3par-performance]&lt;BR /&gt;
filename = ssa_3par_iops.csv&lt;/P&gt;

&lt;P&gt;[root@vspindexlt03 local]# cat ../lookups/ssa_3par_iops.csv&lt;BR /&gt;
DISKTYPE,SPEED,MAX_IOPS,MAX_MBS&lt;BR /&gt;
NL,7,75,30&lt;BR /&gt;
FC,10,150,45&lt;BR /&gt;
FC,15,200,45&lt;/P&gt;

&lt;P&gt;This is working as I see it in the events, but I get a NULL for MAX_IOPS when charting with:&lt;/P&gt;

&lt;P&gt;index=ssa source="dbmon-tail://3Par-System-Reporter/statpd_hires" 3par_array_name=f400xlt01 DISKTYPE=NL SPEED=* PDID=17 OR PDID=18 | eval total_iops=(((d_rcount + d_wcount) * 1000000)/d_now_msec)   | eval read_iops=((d_rcount * 1000000)/d_now_msec)   | eval write_iops=((d_wcount * 1000000)/d_now_msec) | timechart  span=1m max(read_iops) as "Read IOPs", max(write_iops) as "Write IOPs" by PDID | eval maxiops=if(isnull(MAX_IOPS),"75",MAX_IOPS)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165275#M46965</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2020-09-28T16:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165276#M46966</link>
      <description>&lt;P&gt;index=ssa source="dbmon-tail://3Par-System-Reporter/statpd_hires" 3par_array_name=v400xlt01  | table DISKTYPE SPEED MAX_IOPS &lt;/P&gt;

&lt;P&gt;returns MAX_IOPS as 75, 150, 200 depending on the search criteria so that looks fine.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165276#M46966</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2020-09-28T16:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165277#M46967</link>
      <description>&lt;P&gt;&lt;EM&gt;facepalm&lt;/EM&gt; your MAX_IOPS field is 'gone' after the timechart! Add is like &lt;CODE&gt;max(MAX_IOPS) AS MAX_IOPS&lt;/CODE&gt; to the timechart and you should be fine ....&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165277#M46967</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-09-28T16:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165278#M46968</link>
      <description>&lt;P&gt;Hi MuS&lt;/P&gt;

&lt;P&gt;That works but I get a MAX_IOPS per PDID which isn't what I need. I just need one MAX_IOPS for all PDIDs.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:37:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165278#M46968</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2020-09-28T16:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165279#M46969</link>
      <description>&lt;P&gt;Yes, your timechart is by or per PDID. Since you have three different MAX_IOPS in your lookup you will get back three different values. If you only need one either set only one in the lookup or do it like you did in the beginning and set it 'static' using eval.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 13:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165279#M46969</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-15T13:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: eval returning null value for a looked up field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165280#M46970</link>
      <description>&lt;P&gt;Thanks. I only get one MAX_IOPS but per PDID returned. &lt;BR /&gt;
I can't set just one in the lookup as FC and NL types have different values. I need to select one of these based on what someone sets on the dashboard.&lt;/P&gt;

&lt;P&gt;Basically I just need the lookup value based on what someone selects for DISKTYPE and SPEED and plot that independently of anything else. As I'm trying to overlay this on the chart, I don't think that's possible?&lt;/P&gt;

&lt;P&gt;I suppose I could do it with one massive if statement instead of the lookup but that kind of defeats the object :&amp;gt;(&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 14:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-returning-null-value-for-a-looked-up-field/m-p/165280#M46970</guid>
      <dc:creator>ffrig</dc:creator>
      <dc:date>2014-05-15T14:51:03Z</dc:date>
    </item>
  </channel>
</rss>

