<?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: How to use eval with Pivot? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232908#M69113</link>
    <description>&lt;P&gt;Place the eval statement that calculates the HTTPSum in your search before you pipe the pivot. This should then make the field available. Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2016 00:29:25 GMT</pubDate>
    <dc:creator>Melstrathdee</dc:creator>
    <dc:date>2016-11-22T00:29:25Z</dc:date>
    <item>
      <title>How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232901#M69106</link>
      <description>&lt;P&gt;I need to generate a calculated field in Pivot with no luck.&lt;/P&gt;

&lt;P&gt;I tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Statistics HTTP sum(eval(count/3600))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get this error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;The object 'HTTP' has no field 'eval(count/3600'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas pls??&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 14:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232901#M69106</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-18T14:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232902#M69107</link>
      <description>&lt;P&gt;I believe it should be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Statistics HTTP sum(HTTP) as HTTPSum | eval HTTPSum = 'HTTPSum'/3600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that's what you're angling for....&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 19:03:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232902#M69107</guid>
      <dc:creator>pgreer_splunk</dc:creator>
      <dc:date>2016-11-18T19:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232903#M69108</link>
      <description>&lt;P&gt;I need to sum the count over a Period of one hour and find the Transaction per second by dividing the sum(count) by 3600. Following your suggestion, I tried this bu it didn't work. Still getting errors:&lt;/P&gt;

&lt;P&gt;| pivot Statistics HTTP sum(count) as HTTPSum | eval HTTPSum = 'HTTPSum'/3600 SPLITROW _time AS _time PERIOD hour&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 19:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232903#M69108</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-18T19:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232904#M69109</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| pivot Statistics HTTP sum(count) as HTTPSum SPLITROW _time AS _time PERIOD hour | eval HTTPSum = HTTPSum/3600&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;With &lt;CODE&gt;pivot&lt;/CODE&gt; commands, you can only use &lt;CODE&gt;SPLITROW&lt;/CODE&gt; and other &lt;CODE&gt;pivot&lt;/CODE&gt; related options in the pipeline with the &lt;CODE&gt;pivot&lt;/CODE&gt; command.  &lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 10:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232904#M69109</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-11-20T10:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232905#M69110</link>
      <description>&lt;P&gt;Thanks rjthibod,&lt;/P&gt;

&lt;P&gt;I tried your suggestion but pivot still doesn't like it. I get this error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; :&lt;BR /&gt;
Error in 'PivotCell': The object 'HTTP' has no field '|'.&lt;/P&gt;

&lt;P&gt;Any work around would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 16:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232905#M69110</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-20T16:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232906#M69111</link>
      <description>&lt;P&gt;Can you show us a sample of your data please.  Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 20:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232906#M69111</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2016-11-20T20:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232907#M69112</link>
      <description>&lt;P&gt;Hi Melstrathdee,&lt;/P&gt;

&lt;P&gt;Here is an example of my events:&lt;BR /&gt;
I need to sum the count over a Period of one hour and find the Transaction per second by dividing the sum(count) by 3600&lt;/P&gt;

&lt;P&gt;Start Time In MS=1479738420000,Start Time Local=Mon Nov 21 14:27:00 GMT+00:00 2016,End Time In MS=1479738480000,End Time Local=Mon Nov 21 14:28:00 GMT+00:00 2016,Site=W0,Group=HTTP,SourceIP=127.0.0.1,Status=200,URL=&lt;A href="http://127.0.0.1:8080/xmlapi/invoke,Count=24,Rate=0.4,Average"&gt;http://127.0.0.1:8080/xmlapi/invoke,Count=24,Rate=0.4,Average&lt;/A&gt; Latency=1.29166&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 14:31:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232907#M69112</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-21T14:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232908#M69113</link>
      <description>&lt;P&gt;Place the eval statement that calculates the HTTPSum in your search before you pipe the pivot. This should then make the field available. Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 00:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232908#M69113</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2016-11-22T00:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232909#M69114</link>
      <description>&lt;P&gt;Unfortunately I already tried this,&lt;BR /&gt;
eval HTTPSum = count/3600| pivot Statistics HTTP sum(HTTPSum) as "TPS" SPLITROW _time AS _time PERIOD hour &lt;/P&gt;

&lt;P&gt;I'm still getting the error:&lt;BR /&gt;
Error in 'PivotCell': The object 'HTTP' has no field 'HTTPSum'.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 00:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232909#M69114</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-22T00:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232910#M69115</link>
      <description>&lt;P&gt;When you are in search can you pipe the HTTPSum and HTTP into a table to show the value?&lt;BR /&gt;
something like this?&lt;BR /&gt;
source="tutorialdata.zip:*" sourcetype="vendor_sales/vendor_sales" &lt;BR /&gt;
| eval HTTPSum = count/3600|  stats count by HTTPSum Code&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232910#M69115</guid>
      <dc:creator>Melstrathdee</dc:creator>
      <dc:date>2020-09-29T11:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232911#M69116</link>
      <description>&lt;P&gt;I works in search, My problem is with Pivot!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 01:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232911#M69116</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-22T01:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use eval with Pivot?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232912#M69117</link>
      <description>&lt;P&gt;it seems that the new calculated attribute needs to be defined in the HTTP object to work with Pivot? I'm looking for a workaround!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 01:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-eval-with-Pivot/m-p/232912#M69117</guid>
      <dc:creator>emoyoun</dc:creator>
      <dc:date>2016-11-22T01:17:03Z</dc:date>
    </item>
  </channel>
</rss>

