<?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: manipulating different table rows in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581312#M202528</link>
    <description>&lt;P&gt;You can use streamstats only you would need to reverse the order of your events (from your example)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Time	DB2_SSID	CPU_accumulated	Difference
17-1-2022 11:20	DBXH	355363188	19569
17-1-2022 11:19	DBXH	355343619	19437
17-1-2022 11:18	DBXH	355324182	21579
17-1-2022 11:17	DBXH	355302603	22657
17-1-2022 11:16	DBXH	355279946	19793
17-1-2022 11:15	DBXH	355260153	-"
| multikv forceheader=1
| table Time DB2_SSID CPU_accumulated
| reverse
| streamstats range(CPU_accumulated) as Difference window=2
| reverse&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 17 Jan 2022 11:06:22 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-01-17T11:06:22Z</dc:date>
    <item>
      <title>manipulating different table rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581309#M202525</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create the following excel table using splunk. The first 3 columns are based on the output of a query, something like this:&amp;nbsp;&lt;BR /&gt;&amp;lt;query&amp;gt;index=mfpublic sourcetype=SMF100 IFCID=1 DB2_SHARING_GROUP_NAME=$ssid_tok$ DB2_SUBSYSTEM="DBXH"&lt;BR /&gt;| table _time DB2_SSID CPU_accumulated&lt;BR /&gt;&amp;lt;/query&amp;gt;&lt;BR /&gt;The last column is the result of a math operation between first row and second row. Using Excel, column D has the formula: C2-C3 in the first row, then C3-C4 in the second, then C4-C5, and so on.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="79.3562159651095%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="33px"&gt;(A) Time&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="33px"&gt;(B) DB2_SSID&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="33px"&gt;(C) CPU_accumulated&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="33px"&gt;(D) Difference&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:20&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355363188&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;19569&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:19&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355343619&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;19437&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:18&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355324182&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;21579&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:17&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355302603&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;22657&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:16&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355279946&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;19793&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="21.420181613967525%" height="25px"&gt;17-1-2022 11:15&lt;/TD&gt;&lt;TD width="17.853734401690115%" height="25px"&gt;DBXH&lt;/TD&gt;&lt;TD width="19.862342503797148%" height="25px"&gt;355260153&lt;/TD&gt;&lt;TD width="20.219262518926616%" height="25px"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do this math operation between columns from different rows to create another column ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;After having this "column D" I want to create a line chart based on this information.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help !!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 10:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581309#M202525</guid>
      <dc:creator>Ctpelster</dc:creator>
      <dc:date>2022-01-17T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: manipulating different table rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581312#M202528</link>
      <description>&lt;P&gt;You can use streamstats only you would need to reverse the order of your events (from your example)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Time	DB2_SSID	CPU_accumulated	Difference
17-1-2022 11:20	DBXH	355363188	19569
17-1-2022 11:19	DBXH	355343619	19437
17-1-2022 11:18	DBXH	355324182	21579
17-1-2022 11:17	DBXH	355302603	22657
17-1-2022 11:16	DBXH	355279946	19793
17-1-2022 11:15	DBXH	355260153	-"
| multikv forceheader=1
| table Time DB2_SSID CPU_accumulated
| reverse
| streamstats range(CPU_accumulated) as Difference window=2
| reverse&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Jan 2022 11:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581312#M202528</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-17T11:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: manipulating different table rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581345#M202538</link>
      <description>&lt;P&gt;Yes, it worked ! thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the sort option in the query, instead of using the reverse you suggested.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 15:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulating-different-table-rows/m-p/581345#M202538</guid>
      <dc:creator>Ctpelster</dc:creator>
      <dc:date>2022-01-17T15:25:25Z</dc:date>
    </item>
  </channel>
</rss>

