<?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 comparing scores in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741416#M240616</link>
    <description>&lt;P&gt;I am trying to find a way to compare the results listed in a table to each other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically the table lists the results of many different test where some test have the same names, but have been run and rerun so they have same test_names but different test_IDs.&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;TABLE border="1" width="99.87096774193547%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test_name&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;test_id&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;Score&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;Drift&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.98&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;100&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.99&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;98&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;1.00&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;100&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 2&amp;nbsp;&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.01&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;30&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 3&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;0.54&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;34&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 3&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;0.55&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;76&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;42&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a way to take the score from line one and have some sort of logic that will look at the result of the next line and if the test has the sane test_name BUT a different test_ID it will subtract the first lines score from the second lines score and continue along until the (for example) the next line has a different test_name and it skips the line until it finds another line where the following line have the same test_name. and it continues on until all scores are compared.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The delta command almost works but I need to have the ability to say BY test_name&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| delta Score as Drift by test_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unfortunately delta doesn't accept by clauses&lt;/P&gt;&lt;P&gt;I am trying to find a way to calculate the drift column using Splunk so I can create a detection where the drift exceeds a specific threshold.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 14:43:58 GMT</pubDate>
    <dc:creator>dolj</dc:creator>
    <dc:date>2025-03-11T14:43:58Z</dc:date>
    <item>
      <title>comparing scores</title>
      <link>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741416#M240616</link>
      <description>&lt;P&gt;I am trying to find a way to compare the results listed in a table to each other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically the table lists the results of many different test where some test have the same names, but have been run and rerun so they have same test_names but different test_IDs.&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;TABLE border="1" width="99.87096774193547%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test_name&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;test_id&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;Score&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;Drift&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.98&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;100&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.99&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;98&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 1&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;1.00&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;100&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 2&amp;nbsp;&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;.01&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;30&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 3&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;0.54&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;34&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="31.61290322580645%" height="25px"&gt;test 3&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;0.55&lt;/TD&gt;&lt;TD width="22.70967741935484%" height="25px"&gt;76&lt;/TD&gt;&lt;TD width="22.838709677419356%" height="25px"&gt;42&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a way to take the score from line one and have some sort of logic that will look at the result of the next line and if the test has the sane test_name BUT a different test_ID it will subtract the first lines score from the second lines score and continue along until the (for example) the next line has a different test_name and it skips the line until it finds another line where the following line have the same test_name. and it continues on until all scores are compared.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The delta command almost works but I need to have the ability to say BY test_name&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| delta Score as Drift by test_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unfortunately delta doesn't accept by clauses&lt;/P&gt;&lt;P&gt;I am trying to find a way to calculate the drift column using Splunk so I can create a detection where the drift exceeds a specific threshold.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741416#M240616</guid>
      <dc:creator>dolj</dc:creator>
      <dc:date>2025-03-11T14:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: comparing scores</title>
      <link>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741417#M240617</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61094"&gt;@dolj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should be able to use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;streamstats&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;command, which allows you to perform operations on a stream of events and group them by a specific field. In your case, you want to calculate the difference in scores for tests with the same&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test_name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but different&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;test_id. Here's how you can do it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;streamstats&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;command to calculate the difference in scores for each&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;test_name&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;by&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;clause to group the calculations by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;test_name&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's a Splunk search query that should accomplish this:&lt;/P&gt;&lt;PRE&gt;| your_search_here
| sort test_name, test_id
| streamstats current=f last(Score) as previous_score by test_name
| eval Drift = if(isnull(previous_score), null(), Score - previous_score)
| table test_name, test_id, Score, Drift&lt;/PRE&gt;&lt;P&gt;Please let me know how you get on and consider adding karma to this or any other answer if it has helped.&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741417#M240617</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-03-11T14:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: comparing scores</title>
      <link>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741473#M240623</link>
      <description>&lt;P&gt;You made a point of emphasizing the different test_id (&lt;STRONG&gt;&lt;SPAN&gt;sane test_name BUT a different test_ID&lt;/SPAN&gt;&lt;/STRONG&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to have a row with the&amp;nbsp;&lt;STRONG&gt;SAME&amp;nbsp;&lt;/STRONG&gt;test_id at some point, i.e. could you insert a row at row 3 with test_name=test 1 and test_id="0.98"?&lt;/P&gt;&lt;P&gt;If so, the simple streamstats solution suggested by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;won't work.&lt;/P&gt;&lt;P&gt;Is it possible to have the same test_id and if so, what should be the behaviour?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 22:01:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741473#M240623</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-03-11T22:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: comparing scores</title>
      <link>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741507#M240637</link>
      <description>&lt;P&gt;Ah &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, I may have misunderstood the ask here, as you say. I used streamstats by test_name after sorting by (an assumed sequential) test_id. Although I'm not sure why there being the same test_id for multiple test_name would affect the output here, as I'm not using the test_id in the streamstats? I may have missed something though (and not had coffee yet!)&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61094"&gt;@dolj&lt;/a&gt;&amp;nbsp;Please let us know how you are getting on, and if you clarify the requirement I'd be happy to help further and update the previously posted search if required &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please let me know how you get on and consider adding karma to this or any other answer if it has helped.&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 08:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/comparing-scores/m-p/741507#M240637</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-03-12T08:37:45Z</dc:date>
    </item>
  </channel>
</rss>

