<?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: compare two result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678042#M231879</link>
    <description>&lt;P&gt;You could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" "mymodule*:" AND "P[" AND "F[" source="/tmp/*/log.srv23.*.bz2" OR source="/tmp/*/log.srv24.*.bz2" 
| rex field=source "\/.*\/log\.(?&amp;lt;servername&amp;gt;\w+)." 
| rex "P(?&amp;lt;PF&amp;gt;\[\d+\]\[\d+\])" 
``` count by colour and server name ```
| stats count as _PF by PF servername 
``` now collect by colour ```
| stats list(servername) as servername list(_PF) as count by PF&lt;/LI-CODE&gt;&lt;P&gt;which would give you something like this - does this work&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PF&amp;nbsp; hostname&amp;nbsp;count&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;red host1&amp;nbsp; &amp;nbsp; &amp;nbsp; 50&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; host2&amp;nbsp; &amp;nbsp; &amp;nbsp; 90&lt;BR /&gt;&lt;/SPAN&gt;green&amp;nbsp;&lt;SPAN&gt;host1 40&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; host2&amp;nbsp; 90&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;purple host1 50&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yellow host1 90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 07:08:54 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-02-20T07:08:54Z</dc:date>
    <item>
      <title>compare two result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678038#M231878</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a query that need to compare count of PF field for two log file:&lt;/P&gt;&lt;P&gt;on splunk I have two query that create this table, the issue is need to "PF" that equal in query1 and query2 show in same row:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;current result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;hostname1 PF1    count1 hostname2 PF2    count2
host1     red    50     host2     yellow 90
host1     green  40     host2     green  90
host1     purple 50     host2     red    90&lt;/LI-CODE&gt;&lt;P&gt;expected result:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;hostname1 PF1    count1 hostname2 PF2    count2
host1     red    50     host2     red    90
host1     green  40     host2     green  90
host1     purple 50     host2     -      -
host1     -      -      host2     yellow 90&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;here is the query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" "mymodule*:" AND "P[" AND "F[" source="/tmp/*/log.srv23.*.bz2"
| rex field=source "\/.*\/log\.(?&amp;lt;servername&amp;gt;\w+)."
| rex "P(?&amp;lt;PF&amp;gt;\[\d+\]\[\d+\])"
| stats count as _PF by PF,servername | stats list(_PF) as count list(PF) as PF by servername

| appendcols
  [search index="myindex" "mymodule*:" AND "P[" AND "F[" 
  source="/tmp/*/log.srv24.*.bz2"
  | rex field=source "\/.*\/log\.(?&amp;lt;servername&amp;gt;\w+)."
  | rex "P(?&amp;lt;PF2&amp;gt;\[\d+\]\[\d+\])"
  | stats count as _PF2 by PF2,servername | stats list(_PF2) as count 
  list(PF2) as PF2 by servername ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 06:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678038#M231878</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2024-02-22T06:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare two result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678042#M231879</link>
      <description>&lt;P&gt;You could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" "mymodule*:" AND "P[" AND "F[" source="/tmp/*/log.srv23.*.bz2" OR source="/tmp/*/log.srv24.*.bz2" 
| rex field=source "\/.*\/log\.(?&amp;lt;servername&amp;gt;\w+)." 
| rex "P(?&amp;lt;PF&amp;gt;\[\d+\]\[\d+\])" 
``` count by colour and server name ```
| stats count as _PF by PF servername 
``` now collect by colour ```
| stats list(servername) as servername list(_PF) as count by PF&lt;/LI-CODE&gt;&lt;P&gt;which would give you something like this - does this work&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PF&amp;nbsp; hostname&amp;nbsp;count&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;red host1&amp;nbsp; &amp;nbsp; &amp;nbsp; 50&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; host2&amp;nbsp; &amp;nbsp; &amp;nbsp; 90&lt;BR /&gt;&lt;/SPAN&gt;green&amp;nbsp;&lt;SPAN&gt;host1 40&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; host2&amp;nbsp; 90&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;purple host1 50&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;yellow host1 90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 07:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678042#M231879</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-02-20T07:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: compare two result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678109#M231901</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Thanks, Try what you mentioned but not work as I expected,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Change my mind, Is it possible to create table like this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PF &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Host1 &amp;nbsp; &amp;nbsp; &amp;nbsp;Host2 &amp;nbsp; &amp;nbsp; &amp;nbsp;Host3&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;red. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 89&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;purple. &amp;nbsp; &amp;nbsp; &amp;nbsp;30. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;green. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678109#M231901</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2024-02-20T16:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: compare two result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678146#M231916</link>
      <description>&lt;P&gt;Yes, that type of table can be done with chart, so&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| chart count over PF by servername&lt;/LI-CODE&gt;&lt;P&gt;what that won't do is distinguish between which source it came from, which may or may not be relevant to your use case. Do you care if the count is combined between source 1 and source 2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 22:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678146#M231916</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-02-20T22:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: compare two result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678295#M231960</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;thanks, Chart is slow on my data, after several try and error find solution. first using “stats” to extract count, then use “xyseries”.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 05:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-two-result/m-p/678295#M231960</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2024-02-22T05:18:11Z</dc:date>
    </item>
  </channel>
</rss>

