<?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: Report after comparing two events in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509357#M8234</link>
    <description>Presumably, there are many lines of logs between Event 1 and Event 2. How is Splunk supposed to correlate them? They have no common fields.</description>
    <pubDate>Wed, 15 Jul 2020 17:23:26 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-07-15T17:23:26Z</dc:date>
    <item>
      <title>Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509352#M8233</link>
      <description>&lt;P&gt;In my logfile there are two separate lines in there, I need to look at first one and get some of the result but then merge with the above event and create a report like in the following example -&lt;/P&gt;&lt;P&gt;&lt;FONT face="verdana,geneva" size="2"&gt;****** NEW WEBSCRIPT REQUEST ****** [1st Line]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;---&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Uploading file to TestDB from \\server1\TestFolder\out\1stTestforme.pdf&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;---&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;---&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;---&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva" size="2"&gt;Upload Completed /Repo/service/ABC/upload succeeded Request: {empNumber=12345, name=1st Test For Me, uploadedBy=User1, DeptCode=6789, source=App1, mimeType=application/pdf}, Response: {MIMETYPE=application/pdf, SIZE=0.0 KB} [Last Line]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I need to get a report that Provides me a report of all records that that 0KB (Event 2) but File Name should be from the Event 1&lt;/P&gt;&lt;P&gt;So, result Set can be -&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;empNumber source DeptCode UoloadedBy FileName&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;12345&amp;nbsp; &amp;nbsp; &amp;nbsp; App1&amp;nbsp; &amp;nbsp; 6789&amp;nbsp; &amp;nbsp; &amp;nbsp; User1&amp;nbsp; &amp;nbsp;1stTestforme.pdf&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Will appreciate if anyone can help in this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:42:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509352#M8233</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2020-07-15T16:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509357#M8234</link>
      <description>Presumably, there are many lines of logs between Event 1 and Event 2. How is Splunk supposed to correlate them? They have no common fields.</description>
      <pubDate>Wed, 15 Jul 2020 17:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509357#M8234</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-15T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509361#M8235</link>
      <description>&lt;P&gt;Thanks Rich.&lt;/P&gt;&lt;P&gt;Yes, there can be lot of lines but this upload goes in one set of batch.&lt;/P&gt;&lt;P&gt;First line starts with&amp;nbsp; -&amp;nbsp;&lt;FONT face="courier new,courier"&gt;****** NEW WEBSCRIPT REQUEST ******&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;and Last line ends with - &lt;FONT face="courier new,courier"&gt;SIZE=0.0 KB}&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 17:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509361#M8235</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2020-07-15T17:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509363#M8236</link>
      <description>&lt;P&gt;secondly, there is another row in there which provides the Query String and it has info like -&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Query String: empNumber=12345&amp;amp;deptCode=6789&amp;amp;source=App1&amp;amp;contentType=letter&amp;amp;location=D:\testfolder\out\1stTestforme.pdf&amp;amp;name=1st+Test+For+Me&amp;amp;uploadedBy=User1&amp;amp;mimeTYpe=application%2Fpdf&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;As you can see it has Location and Name.&lt;/P&gt;&lt;P&gt;I need to get Location but in the Query I don't have response which shows 0KB.&lt;/P&gt;&lt;P&gt;So, query first need to read -&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Upload Completed /Repo/service/ABC/upload succeeded Request: {empNumber=12345, name=1st Test For Me, uploadedBy=User1, DeptCode=6789, source=App1, mimeType=application/pdf}, Response: {MIMETYPE=application/pdf, SIZE=0.0 KB} [Last Line]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Get all the reset set and then later search the above line (query string) to see what the value there is in the location. and bring it in the report. Query String also has "name" which has been replaced "space" by "+" in Query String.&lt;/P&gt;&lt;P&gt;So, report should get info from these two rows....&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;------ Upload Complete Line ------&amp;nbsp; &amp;nbsp; &amp;nbsp;-- Query String --&lt;BR /&gt;empNumber source DeptCode UoloadedBy&amp;nbsp; &amp;nbsp; &amp;nbsp; FileName&lt;BR /&gt;12345&amp;nbsp; &amp;nbsp; &amp;nbsp; App1&amp;nbsp; &amp;nbsp;6789&amp;nbsp; &amp;nbsp; &amp;nbsp;User1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1stTestforme.pdf&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this new info helps.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 17:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509363#M8236</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2020-07-15T17:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509374#M8238</link>
      <description>&lt;P&gt;See if this helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo ("Query String:" OR "Upload Completed")
```Extract fields.  These rex commands can be removed if the fields are extracted automatically.```
| rex "empNumber=(?&amp;lt;empNumber&amp;gt;\d+)"
| rex "deptCode=(?&amp;lt;DeptCode&amp;gt;\d+)"
| rex "source=(?&amp;lt;Source&amp;gt;[^,]+)"
| rex "uploadedBy=(?&amp;lt;uploadedBy&amp;gt;[^&amp;amp;,]"
| rex "name=(?&amp;lt;name&amp;gt;[^&amp;amp;,]+)"
| rex "location=(?&amp;lt;location&amp;gt;[^&amp;amp;]+)"
```Keep everything below```
| replace "+" with " " in name
| rex "\\(?&amp;lt;FileName&amp;gt;\w+\.?\w+$)"
| stats values(*) as * by empNumber, Source, DeptCode, uploadedBy
| table empNumber, Source, DeptCode, uploadedBy, FileName&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509374#M8238</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-15T19:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509385#M8240</link>
      <description>&lt;P&gt;Thanks a lot Rich.&lt;/P&gt;&lt;P&gt;Can you confirm "FileName" in report will give me whats in Location &lt;STRONG&gt;1stTestforme.pdf&lt;/STRONG&gt; (&lt;SPAN&gt;D:\testfolder\out\1stTestforme.pdf&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;I updated the Query so that it gets only 0KB file and escape was not working so added two back slash.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;index=foo ("Query String:" OR "Upload Completed" AND "SIZE=0.0 KB" )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "empNumber=(?&amp;lt;empNumber&amp;gt;\d+)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "deptCode=(?&amp;lt;DeptCode&amp;gt;\d+)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "source=(?&amp;lt;Source&amp;gt;[^,]+)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "uploadedBy=(?&amp;lt;uploadedBy&amp;gt;[^&amp;amp;,]"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "name=(?&amp;lt;name&amp;gt;[^&amp;amp;,]+)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "location=(?&amp;lt;location&amp;gt;[^&amp;amp;]+)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| replace "+" with " " in name&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| rex "\\\\(?&amp;lt;FileName&amp;gt;\w+\.?\w+$)"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| stats values(*) as * by empNumber, Source, DeptCode, uploadedBy&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;| table _time empNumber, Source, DeptCode, uploadedBy, FileName&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But what I am seeing is although the search works fine ans shows 12 events -&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Complete 12 events (7/15/20 11:44:00.000 AM to 7/15/20 3:44:32.000 PM)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But I don't see any output in report.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509385#M8240</guid>
      <dc:creator>runiyal</dc:creator>
      <dc:date>2020-07-15T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509392#M8242</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal |head 1 | fields _raw _time | eval _raw="****** NEW WEBSCRIPT REQUEST ******
---
Uploading file to TestDB from \\server1\TestFolder\out\1stTestforme.pdf
---
---
---
Upload Completed /Repo/service/ABC/upload succeeded Request: {empNumber=12345, name=1st Test For Me, uploadedBy=User1, DeptCode=6789, source=App1, mimeType=application/pdf}, Response: {MIMETYPE=application/pdf, SIZE=0.0 KB}"
| kv
| rex max_match=0 "Uploading file .*\\\(?&amp;lt;FileName&amp;gt;\S+)"&lt;/LI-CODE&gt;&lt;P&gt;We can't see the entire log, so We can't make the query.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 20:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509392#M8242</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-15T20:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Report after comparing two events</title>
      <link>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509427#M8246</link>
      <description>Yes, the FileName field is intended to be the file name part of the location field.&lt;BR /&gt;The lack of results could be because one of the inputs to the stats command is empty. Try running the query without "stats" and "table".</description>
      <pubDate>Thu, 16 Jul 2020 00:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Report-after-comparing-two-events/m-p/509427#M8246</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-16T00:31:02Z</dc:date>
    </item>
  </channel>
</rss>

