<?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: SPLUNK query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181094#M52218</link>
    <description>&lt;P&gt;Sample output of the query:&lt;BR /&gt;
3/10/14 &lt;BR /&gt;
5:09:11.000 PM      &lt;TRANSTIME&gt;686&lt;/TRANSTIME&gt;&lt;BR /&gt;&lt;BR /&gt;
host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml &lt;BR /&gt;
3/10/14 &lt;BR /&gt;
5:09:11.000 PM      &lt;FILESIZE&gt;273431&lt;/FILESIZE&gt;&lt;BR /&gt;&lt;BR /&gt;
filesize = 273431 host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2014 17:16:11 GMT</pubDate>
    <dc:creator>sushma6</dc:creator>
    <dc:date>2014-03-11T17:16:11Z</dc:date>
    <item>
      <title>SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181082#M52206</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I had input some logs into splunk and now I need someone's help to write a query such that I get the reults in the way I want.&lt;/P&gt;

&lt;P&gt;I ran the following search query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=SCAWTR813 source="E:\\SPLUNK\\FTPlogs _HYDservers\\APP04\\ifs20140310.xml" AND "filesize" OR "transtime"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the output i received is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;3/10/14 
5:09:11.000 PM  
    &amp;lt;transtime&amp;gt;686&amp;lt;/transtime&amp;gt;
host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml
3/10/14 
5:09:11.000 PM  
    &amp;lt;filesize&amp;gt;273431&amp;lt;/filesize&amp;gt;
host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now at the same timestamp I have filesize and transtime.&lt;/P&gt;

&lt;P&gt;I need a query such that I get the value of filesize/timestamp for a particular timestamp.&lt;/P&gt;

&lt;P&gt;Please help!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 08:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181082#M52206</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T08:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181083#M52207</link>
      <description>&lt;P&gt;Is there a reason for breaking the XML file into several small events?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 13:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181083#M52207</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-11T13:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181084#M52208</link>
      <description>&lt;P&gt;Because I need to get filesize and transtime values out of the xml file, and then perform filesize/transtime, need a query for this&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 15:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181084#M52208</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T15:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181085#M52209</link>
      <description>&lt;P&gt;are these two events or single event containing both the details?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:14:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181085#M52209</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-03-11T16:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181086#M52210</link>
      <description>&lt;P&gt;they are two separate events not the single event&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181086#M52210</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T16:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181087#M52211</link>
      <description>&lt;P&gt;You can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=SCAWTR813 source="E:\\SPLUNK\\FTPlogs _HYDservers\\APP04\\ifs20140310.xml" AND "filesize" OR "transtime" | spath | eventstats avg(filesize) as filesize avg(transtime) as transtime | eval avg=filesize/transtime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That assumes your search only yields those two events listed in your question, nothing else. It copies each field into the other event and adds the average to each event.&lt;/P&gt;

&lt;P&gt;Note, I still recommend questioning why these events are split up instead of being part of one larger event for the XML file.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181087#M52211</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-11T16:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181088#M52212</link>
      <description>&lt;P&gt;I ran the your query but the output I get is same as the one as posted above what i need is filesize/transtime&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181088#M52212</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T16:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181089#M52213</link>
      <description>&lt;P&gt;Check the field list on the left for avg.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181089#M52213</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-11T16:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181090#M52214</link>
      <description>&lt;P&gt;Actually i have not split the events i just gave the xml file as input and from the xml file i was searching for keywords filesize and transtime,to do so i ran the above query and i could get list of filesize and transtime keywords out of it,but not sure how to retrive the value between the xml tags i.e.  the output above shows &lt;FILESIZE&gt; 234 &lt;/FILESIZE&gt; and &lt;TRANSTIME&gt;24&lt;/TRANSTIME&gt; and both are displayed as two different events, now what i want is 234/24, calculate and place the output in a new varaiable. hope now I am clear. I even tried out the command xmlkv, xpath and spath but no use...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181090#M52214</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181091#M52215</link>
      <description>&lt;P&gt;To the left on the field list I could find avg and a single value for it, I dont want avg(filesize)/avg(transtime).&lt;BR /&gt;
At a partcular timestamp filesize and transtime are generated in my excel so at that period what is the value of filesize/transtime, at another timestamp these two values may be different so i need the value at different timestamps&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 16:58:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181091#M52215</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T16:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181092#M52216</link>
      <description>&lt;P&gt;Sample output of transtime is as follows:&lt;/P&gt;

&lt;P&gt;1 Value, 100% of events&lt;/P&gt;

&lt;P&gt;Reports&lt;BR /&gt;
Average over timeMaximum value over timeMinimum value timeTop valuesTop values by timeRare valuesEvents with this fieldAvg: 4378.691457 Min: 4378.691457 Max: 4378.691457 Std Dev: 0 Values Count %&lt;BR /&gt;&lt;BR /&gt;
4378.691457 88,146 100% &lt;/P&gt;

&lt;P&gt;Similary for filesize and avg..but it is just showing the avg of all the filesize and transtime&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 17:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181092#M52216</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T17:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181093#M52217</link>
      <description>&lt;P&gt;You can add a &lt;CODE&gt;by _time&lt;/CODE&gt; to the &lt;CODE&gt;eventstats&lt;/CODE&gt; if you're certain the timestamps for both events will always be identical and unique.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 17:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181093#M52217</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-11T17:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181094#M52218</link>
      <description>&lt;P&gt;Sample output of the query:&lt;BR /&gt;
3/10/14 &lt;BR /&gt;
5:09:11.000 PM      &lt;TRANSTIME&gt;686&lt;/TRANSTIME&gt;&lt;BR /&gt;&lt;BR /&gt;
host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml &lt;BR /&gt;
3/10/14 &lt;BR /&gt;
5:09:11.000 PM      &lt;FILESIZE&gt;273431&lt;/FILESIZE&gt;&lt;BR /&gt;&lt;BR /&gt;
filesize = 273431 host = SCAWTR813 source = E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml sourcetype = xml&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 17:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181094#M52218</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T17:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181095#M52219</link>
      <description>&lt;P&gt;Now if you see the above query on 10th March at 10PM i have the values for filesize and transtime, i need the output of filesize/transtime, similarly i have values for filesize and transtime at 11 on the same day, i need the value for filesize/transtime&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 17:17:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181095#M52219</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T17:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181096#M52220</link>
      <description>&lt;P&gt;Any idea on this, please help!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2014 18:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181096#M52220</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-11T18:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181097#M52221</link>
      <description>&lt;P&gt;What's wrong with this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=SCAWTR813 source="E:\\SPLUNK\\FTPlogs _HYDservers\\APP04\\ifs20140310.xml" AND "filesize" OR "transtime" | spath | eventstats avg(filesize) as filesize avg(transtime) as transtime by _time | eval avg=filesize/transtime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Mar 2014 18:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181097#M52221</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-11T18:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181098#M52222</link>
      <description>&lt;P&gt;If you dont mind could you please explain me the query in detail..Actually under the avg field to the left, I could find some values but I could not find out which value of filesize/transtime has been listed there&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 04:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181098#M52222</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-12T04:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181099#M52223</link>
      <description>&lt;P&gt;Hi Sushma6,&lt;/P&gt;

&lt;P&gt;Probably u need this ..&lt;/P&gt;

&lt;P&gt;host=SCAWTR813 source="E:\SPLUNK\FTPlogs _HYDservers\APP04\ifs20140310.xml" AND "filesize" OR "transtime"  | transaction keepevicted=true _time | rex "filesize&amp;gt;(?&lt;FILESIZE&gt;[^&amp;lt;]&lt;EM&gt;)&amp;lt;" | rex"transtime&amp;gt;(?&lt;TRANSTIME&gt;[^&amp;lt;]&lt;/TRANSTIME&gt;&lt;/EM&gt;)&amp;lt;" | eval MyField = filesize + "/" + transtime | table _time,MyField&lt;/FILESIZE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 07:06:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181099#M52223</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2014-03-12T07:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181100#M52224</link>
      <description>&lt;P&gt;My query works like this:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;search for your events&lt;/LI&gt;
&lt;LI&gt;apply &lt;CODE&gt;spath&lt;/CODE&gt; field extraction from structured XML data&lt;/LI&gt;
&lt;LI&gt;compute the average value for both fields for every timestamp&lt;/LI&gt;
&lt;LI&gt;calculate filesize divided by transtime, store in field avg&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;If you're confused by the output of &lt;CODE&gt;eventstats&lt;/CODE&gt;, adding fields to the existing events, you can change to &lt;CODE&gt;stats&lt;/CODE&gt; instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=SCAWTR813 source="E:\\SPLUNK\\FTPlogs _HYDservers\\APP04\\ifs20140310.xml" AND "filesize" OR "transtime" | spath | stats avg(filesize) as filesize avg(transtime) as transtime by _time | eval avg=filesize/transtime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Mar 2014 08:16:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181100#M52224</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-12T08:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: SPLUNK query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181101#M52225</link>
      <description>&lt;P&gt;Appreciate your help! and am getting the required data&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 10:26:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SPLUNK-query/m-p/181101#M52225</guid>
      <dc:creator>sushma6</dc:creator>
      <dc:date>2014-03-12T10:26:30Z</dc:date>
    </item>
  </channel>
</rss>

