<?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 Did some math on a chart but need to take results to a timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446058#M126572</link>
    <description>&lt;P&gt;Have a working query, but the boss has now asked me to timechart for SuccessRateByPlatformPCT per week and I am having a bear of a time getting it from here to there. Any insights appreciated. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=foo
    | eval date=strftime(_time, "%x") 
    | eval ComputerPlatformString=len(AssetID) 
    | eval ComputerPlatform=case(ComputerPlatformString=0, "Unknown/Multiple_LVDI_and_Desktop", ComputerPlatformString=3, "Laptop/Desktop", ComputerPlatformString=8, "Laptop/Desktop", ComputerPlatformString=9, "LVDI", ComputerPlatformString=10, "PSI/VSI", ComputerPlatformString=11, "AppSphere", ComputerPlatformString=12, "AppSphere", ComputerPlatformString=13, "AppSphere", ComputerPlatformString=14, "WorkStation", ComputerPlatformString=15, "VSI", ComputerPlatformString=18, "VDesk Terminal", ComputerPlatformString=20, "VDesk") 
    | where ComputerPlatform="AppSphere" OR ComputerPlatform="LVDI" OR ComputerPlatform="Laptop/Desktop" OR ComputerPlatform="VDesk" 
    |  transaction UniqueIdentifier 
    | chart dc(UniqueIdentifier) by ComputerPlatform Reply
    | eval SuccessRateByPlatformPCT = round((RESOLVED) / (RESOLVED + NOTRESOLVED)*100, 2) 
    | eventstats sum(RESOLVED) as TOTALRESOLVED , sum(NOTRESOLVED) AS TOTALNOTRESOLVED, sum(NORESPONSE) AS TOTALNORESPONSE 
    | addtotals  NORESPONSE NOTRESOLVED RESOLVED fieldname=TotalUses 
    | addcoltotals NORESPONSE NOTRESOLVED RESOLVED TotalUses labelfield=ComputerPlatform label=Total
    | table ComputerPlatform NORESPONSE NOTRESOLVED RESOLVED SuccessRateByPlatform TotalUses
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;resulting chart 
| ComputerPlatform | NORESPONSE | NOTRESOLVED | RESOLVED | SuccessRateByPlatformPCT | TotalUses
| LVDI          |   1       |      2      |     8    |             80.00        |     11
| Laptop/Desktop   |    3       |      3      |     7    |             70.00        |     13
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Feb 2019 20:40:32 GMT</pubDate>
    <dc:creator>nqjpm</dc:creator>
    <dc:date>2019-02-05T20:40:32Z</dc:date>
    <item>
      <title>Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446058#M126572</link>
      <description>&lt;P&gt;Have a working query, but the boss has now asked me to timechart for SuccessRateByPlatformPCT per week and I am having a bear of a time getting it from here to there. Any insights appreciated. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index=foo
    | eval date=strftime(_time, "%x") 
    | eval ComputerPlatformString=len(AssetID) 
    | eval ComputerPlatform=case(ComputerPlatformString=0, "Unknown/Multiple_LVDI_and_Desktop", ComputerPlatformString=3, "Laptop/Desktop", ComputerPlatformString=8, "Laptop/Desktop", ComputerPlatformString=9, "LVDI", ComputerPlatformString=10, "PSI/VSI", ComputerPlatformString=11, "AppSphere", ComputerPlatformString=12, "AppSphere", ComputerPlatformString=13, "AppSphere", ComputerPlatformString=14, "WorkStation", ComputerPlatformString=15, "VSI", ComputerPlatformString=18, "VDesk Terminal", ComputerPlatformString=20, "VDesk") 
    | where ComputerPlatform="AppSphere" OR ComputerPlatform="LVDI" OR ComputerPlatform="Laptop/Desktop" OR ComputerPlatform="VDesk" 
    |  transaction UniqueIdentifier 
    | chart dc(UniqueIdentifier) by ComputerPlatform Reply
    | eval SuccessRateByPlatformPCT = round((RESOLVED) / (RESOLVED + NOTRESOLVED)*100, 2) 
    | eventstats sum(RESOLVED) as TOTALRESOLVED , sum(NOTRESOLVED) AS TOTALNOTRESOLVED, sum(NORESPONSE) AS TOTALNORESPONSE 
    | addtotals  NORESPONSE NOTRESOLVED RESOLVED fieldname=TotalUses 
    | addcoltotals NORESPONSE NOTRESOLVED RESOLVED TotalUses labelfield=ComputerPlatform label=Total
    | table ComputerPlatform NORESPONSE NOTRESOLVED RESOLVED SuccessRateByPlatform TotalUses
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;resulting chart 
| ComputerPlatform | NORESPONSE | NOTRESOLVED | RESOLVED | SuccessRateByPlatformPCT | TotalUses
| LVDI          |   1       |      2      |     8    |             80.00        |     11
| Laptop/Desktop   |    3       |      3      |     7    |             70.00        |     13
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446058#M126572</guid>
      <dc:creator>nqjpm</dc:creator>
      <dc:date>2019-02-05T20:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446059#M126573</link>
      <description>&lt;P&gt;We will be able to help you better if you can provide a couple of lines of sample data.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446059#M126573</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-05T20:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446060#M126574</link>
      <description>&lt;P&gt;Give this a try. If you want to calculate success rate on more granular spans, change the span in bucket command to 1d or whatever you need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo
     | eval date=strftime(_time, "%x") 
     | eval ComputerPlatformString=len(AssetID) 
     | eval ComputerPlatform=case(ComputerPlatformString=0, "Unknown/Multiple_LVDI_and_Desktop", ComputerPlatformString=3, "Laptop/Desktop", ComputerPlatformString=8, "Laptop/Desktop", ComputerPlatformString=9, "LVDI", ComputerPlatformString=10, "PSI/VSI", ComputerPlatformString=11, "AppSphere", ComputerPlatformString=12, "AppSphere", ComputerPlatformString=13, "AppSphere", ComputerPlatformString=14, "WorkStation", ComputerPlatformString=15, "VSI", ComputerPlatformString=18, "VDesk Terminal", ComputerPlatformString=20, "VDesk") 
     | where ComputerPlatform="AppSphere" OR ComputerPlatform="LVDI" OR ComputerPlatform="Laptop/Desktop" OR ComputerPlatform="VDesk" 
     |  transaction UniqueIdentifier 
     | bucket span=1w _time
     | chart dc(UniqueIdentifier) by _time ComputerPlatform Reply
     | eval SuccessRateByPlatformPCT = round((RESOLVED) / (RESOLVED + NOTRESOLVED)*100, 2) 
     | timechart span=1w avg(SuccessRateByPlatformPCT) by ComputerPlatform
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446060#M126574</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-02-05T20:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446061#M126575</link>
      <description>&lt;P&gt;I'm unfortunately limited by our security policy. I cant be very specific.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 21:01:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446061#M126575</guid>
      <dc:creator>nqjpm</dc:creator>
      <dc:date>2019-02-05T21:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446062#M126576</link>
      <description>&lt;P&gt;When I use &lt;BR /&gt;
    | chart dc(UniqueIdentifier) by _time ComputerPlatform Reply &lt;BR /&gt;
It now gives me an error "Error in 'chart' command: The argument 'Reply' is invalid."&lt;BR /&gt;
Not sure why _time kills the search. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 21:07:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446062#M126576</guid>
      <dc:creator>nqjpm</dc:creator>
      <dc:date>2019-02-05T21:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Did some math on a chart but need to take results to a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446063#M126577</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo
| eval ComputerPlatformString=len(AssetID) 
| eval ComputerPlatform=case(ComputerPlatformString=0, "Unknown/Multiple_LVDI_and_Desktop", ComputerPlatformString=1, "Laptop/Desktop", ComputerPlatformString=2, "Laptop/Desktop", ComputerPlatformString=3, "LVDI", ComputerPlatformString=10, "PSI/VSI", ComputerPlatformString=11, "AppSphere", ComputerPlatformString=12, "AppSphere", ComputerPlatformString=13, "AppSphere", ComputerPlatformString=14, "WorkStation", ComputerPlatformString=15, "VSI", ComputerPlatformString=18, "VDesk Terminal", ComputerPlatformString=20, "VDesk")
| where ComputerPlatform="AppSphere" OR ComputerPlatform="LVDI" OR ComputerPlatform="Laptop/Desktop" OR ComputerPlatform="VDesk"
| bin _time span=1w
| stats values(*) AS * BY UniqueIdentifier _time
| eval ComputerPlatform = _time . "@" . ComputerPlatform
| chart dc(UniqueIdentifier) AS UniqueIdentifieCountr BY ComputerPlatform Reply
| rex field=ComputerPlatform "^(?&amp;lt;_time&amp;gt;\d+)@(?&amp;lt;ComputerPlatform&amp;gt;.*)$"
| eval SuccessRateByPlatformPCT = round((RESOLVED) / (RESOLVED + NOTRESOLVED)*100, 2) 
| eventstats sum(RESOLVED) AS TOTALRESOLVED , sum(NOTRESOLVED) AS TOTALNOTRESOLVED, sum(NORESPONSE) AS TOTALNORESPONSE 
| addtotals NORESPONSE NOTRESOLVED RESOLVED fieldname=TotalUses 
| addcoltotals NORESPONSE NOTRESOLVED RESOLVED TotalUses labelfield=ComputerPlatform label=Total 
| table _time ComputerPlatform NORESPONSE NOTRESOLVED RESOLVED SuccessRateByPlatformPCT TotalUses
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2019 20:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Did-some-math-on-a-chart-but-need-to-take-results-to-a-timechart/m-p/446063#M126577</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-08T20:59:26Z</dc:date>
    </item>
  </channel>
</rss>

