<?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: Using chained eval or separate eval statements, any performance gains? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417512#M120141</link>
    <description>&lt;P&gt;@stanwin I also feel they are only for making eval more readable. Similarly for &lt;CODE&gt;rename&lt;/CODE&gt; command as well. But may be someone from Splunk may confirm that it is just for readability or more!&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 17:35:17 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-08-21T17:35:17Z</dc:date>
    <item>
      <title>Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417510#M120139</link>
      <description>&lt;P&gt;Is there any performance benefit in :&lt;/P&gt;

&lt;P&gt;using one eval with several chained statements &lt;/P&gt;

&lt;P&gt;v/s&lt;/P&gt;

&lt;P&gt;using separate eval statements ( which may be split to  improve SPL readability for extremely large SPL's)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval A = "OM"
| eval B = " NOM"
| eval C = " NOM"
| eval D= " NOM"
| eval E = " NOM"

or 

| eval A = "OM"  ,  B = " NOM"  ,  C = " NOM" ,  D= " NOM"  ,  E = " NOM"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417510#M120139</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-08-21T15:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417511#M120140</link>
      <description>&lt;P&gt;@stanwin,&lt;/P&gt;

&lt;P&gt;I'm not sure about the performance benefit using chained eval.&lt;BR /&gt;
The chained eval supported in Splunk 6.4 version. As per my suggestion to go with separate eval statements for backwards compatibility and readability. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 16:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417511#M120140</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-08-21T16:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417512#M120141</link>
      <description>&lt;P&gt;@stanwin I also feel they are only for making eval more readable. Similarly for &lt;CODE&gt;rename&lt;/CODE&gt; command as well. But may be someone from Splunk may confirm that it is just for readability or more!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 17:35:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417512#M120141</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-08-21T17:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417513#M120142</link>
      <description>&lt;P&gt;TL;DR: It appears chained evals are slightly faster than separated evals.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Methodology:&lt;/STRONG&gt;&lt;BR /&gt;
We are able to go through this ourselves using the &lt;A href="https://docs.splunk.com/Splexicon:Searchjobinspector"&gt;job inspector&lt;/A&gt;.&lt;BR /&gt;
Following is a run anywhere example scaled up and ran in verbose mode, so differences might be seen.&lt;/P&gt;

&lt;P&gt;The &lt;EM&gt;gentimes&lt;/EM&gt; command is used to generate unique timestamps at 1 second for each event, so we get unique events every time we run the search. In the command below, it generates 8,640,000 events (which is the number of seconds in 100 days).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Chained Command:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-100 end=0 increment=1s
| eval A = "OM" , B = "NOM" , C = "NOM" , D = "NOM" , E = "NOM" , F = "OM" , G = "NOM" , H = "NOM" , I = "NOM" , J = "NOM" , K = "OM" , L = "NOM" , M = "NOM" , N = "NOM" , O = "NOM" , P = "OM" , Q = "NOM" , R = "NOM" , S = "NOM" , T = "NOM" , U = "OM" , V = "NOM" , W = "NOM" , X = "NOM" , Y = "NOM" , Z = "OM"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Separated Command:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-100 end=0 increment=1s
| eval A = "OM" 
| eval B = "NOM" 
| eval C = "NOM" 
| eval D = "NOM" 
| eval E = "NOM" 
| eval F = "OM" 
| eval G = "NOM" 
| eval H = "NOM" 
| eval I = "NOM" 
| eval J = "NOM" 
| eval K = "OM" 
| eval L = "NOM" 
| eval M = "NOM" 
| eval N = "NOM" 
| eval O = "NOM" 
| eval P = "OM" 
| eval Q = "NOM" 
| eval R = "NOM" 
| eval S = "NOM" 
| eval T = "NOM" 
| eval U = "OM" 
| eval V = "NOM" 
| eval W = "NOM" 
| eval X = "NOM" 
| eval Y = "NOM" 
| eval Z = "OM"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Results:&lt;/STRONG&gt;&lt;/P&gt;

&lt;H1&gt;of Events = 8,640,000&lt;/H1&gt;

&lt;P&gt;Chained Evals Search Time = 325.429 (80.13 seconds for the command.eval)&lt;BR /&gt;
Separated Evals Search Time = 348.053 (98.77 seconds for the command.eval)&lt;/P&gt;

&lt;P&gt;I seem to recall, but was not able to locate a reference, that every pipe costs &lt;EM&gt;something&lt;/EM&gt;. In this example of 8.64 million events, that looks to be at least 18 seconds more using separated evals than chained evals (the remaining time is between running command.gentimes). YMMV based on your needs and your infrastructure, but it might be worth the readability to use the extra text and separate the evals.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 21:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417513#M120142</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2018-08-21T21:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417514#M120143</link>
      <description>&lt;P&gt;yes , but in cases like for example normalizing data etc with huge number of eval statements e.g 150+ if we consider..  will it be more efficient/performant? only Splunk can comment on that.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:23:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417514#M120143</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-08-22T14:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417515#M120144</link>
      <description>&lt;P&gt;Thanks for the check efavreau  , I did something similar myself. &lt;/P&gt;

&lt;P&gt;But the test numbers are too transient due to environmental factors. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417515#M120144</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-08-22T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417516#M120145</link>
      <description>&lt;P&gt;You can use this methodology to see the impact of the different eval construction. Run it multiple times, and see the trend between the two. That's what I am providing here. There is an observable difference on large data sets.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417516#M120145</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2018-08-22T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using chained eval or separate eval statements, any performance gains?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417517#M120146</link>
      <description>&lt;P&gt;Right thanks efavreau , yes makes sense that it probably may take longer for larger datasets. &lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 14:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-chained-eval-or-separate-eval-statements-any-performance/m-p/417517#M120146</guid>
      <dc:creator>stanwin</dc:creator>
      <dc:date>2018-08-30T14:45:08Z</dc:date>
    </item>
  </channel>
</rss>

