<?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: How to get a ratio of two fields based on condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554822#M157478</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14525i0CEB200AD7D960C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Sure, here is an example&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 06:03:32 GMT</pubDate>
    <dc:creator>Rokas_Strazdas</dc:creator>
    <dc:date>2021-06-08T06:03:32Z</dc:date>
    <item>
      <title>How to get a ratio of two fields based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554416#M157370</link>
      <description>&lt;P&gt;Following is the data I have:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Time (DD/MM/YYYY 00:00:00)&lt;/LI&gt;&lt;LI&gt;Delay_class (String value, example "B. &amp;gt; 15 MIN" or "A. &amp;lt; 15MIN")&lt;/LI&gt;&lt;LI&gt;NumberOfOccurances (integer, numeric values of traffic count, for example, "314" or "96606")&lt;/LI&gt;&lt;LI&gt;Others (Fields that are not important in this case)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to do is to show a ratio of the two delay classes with corresponding time limitations (like the ones seen in the example) based on the number of occurrences.&lt;/P&gt;&lt;P&gt;So, for example, on the 4th of June all of the combined NumberOfOccurances for the delay class of "B. &amp;gt; 15 MIN" are 50000, while all of the combined (summed) NumberOfOccurances on the same day for a corresponding delay class "A. &amp;lt; 15MIN" are 1000000, so I'd like to see the ratio of 0,05 shown in a Pivot table of visualization of some sort. How do I achieve that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 06:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554416#M157370</guid>
      <dc:creator>Rokas_Strazdas</dc:creator>
      <dc:date>2021-06-04T06:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a ratio of two fields based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554547#M157398</link>
      <description>Can you share couple of line your events? It’s easier to understand and answer to your question.</description>
      <pubDate>Fri, 04 Jun 2021 20:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554547#M157398</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-06-04T20:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a ratio of two fields based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554822#M157478</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14525i0CEB200AD7D960C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Sure, here is an example&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 06:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554822#M157478</guid>
      <dc:creator>Rokas_Strazdas</dc:creator>
      <dc:date>2021-06-08T06:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a ratio of two fields based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554846#M157484</link>
      <description>&lt;LI-CODE lang="markup"&gt;source="CombinedA.csv" host="DESKTOP-NNPLERL" sourcetype="csv" DELAY_CLASS="*325*"
| bin span=1d _time
| stats sum(NumberOfOccurances) as NumberOfOccurances by _time DELAY_CLASS
| eval limitation=substr(DELAY_CLASS,5,len(DELAY_CLASS)-5)
| eval class=substr(DELAY_CLASS,1,1)
| eval {class}_count=NumberOfOccurances
| table limitation _time *_count
| stats values(*) as * by _time limitation
| eval ratio=A_count/B_count&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Jun 2021 08:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-ratio-of-two-fields-based-on-condition/m-p/554846#M157484</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-08T08:03:45Z</dc:date>
    </item>
  </channel>
</rss>

