<?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 edit my search to show the count and percentage per id for each day? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287938#M87160</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ips_api earliest=-15d updatesearch | rex field=summary "(?\{.*)" | spath input=json_data  | bucket _time span=1d | stats count by _time asset_data{}.id | rename asset_data{}.id  as id | eventstats sum(count) as total by _time | eval percentage=round(count*100/total,2) 
| table _time id count percentage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Apr 2016 19:32:35 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-04-12T19:32:35Z</dc:date>
    <item>
      <title>How to edit my search to show the count and percentage per id for each day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287936#M87158</link>
      <description>&lt;P&gt;Hey.&lt;/P&gt;

&lt;P&gt;I'm quite new with Splunk and learning for the moment. I need to show a table with " Time id count percentage "&lt;BR /&gt;
For the last 15 days, I need to know the count of backend calls per id for each day.&lt;BR /&gt;
I already extracted the Ids from a json file and now just need to show them as the way I described.&lt;/P&gt;

&lt;P&gt;I'm trying some things I only have this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ips_api earliest=-15d updatesearch | rex field=summary "(?\{.*)" | spath input=json_data |timechart span=1d count by asset_data{}.id 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it doesn't show me what I want. It just shows a table with field time and the name of each asset id in other field with the counts of each search on backend like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time   id12345  1269785  id9874   
4/11      85       29       5          
4/12      67       35       7    
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2016 17:44:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287936#M87158</guid>
      <dc:creator>guillecasco</dc:creator>
      <dc:date>2016-04-12T17:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to show the count and percentage per id for each day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287937#M87159</link>
      <description>&lt;P&gt;It'd help if you provided some sample data along with a sketch of what your results table should look like.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 19:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287937#M87159</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-12T19:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to show the count and percentage per id for each day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287938#M87160</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ips_api earliest=-15d updatesearch | rex field=summary "(?\{.*)" | spath input=json_data  | bucket _time span=1d | stats count by _time asset_data{}.id | rename asset_data{}.id  as id | eventstats sum(count) as total by _time | eval percentage=round(count*100/total,2) 
| table _time id count percentage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2016 19:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287938#M87160</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-12T19:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to show the count and percentage per id for each day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287939#M87161</link>
      <description>&lt;P&gt;I missunderstood the question. Didn't have to  put 15 rows for the 15 last days, Just look up in the logs of the last 15 days and extract that information. So final query (With your help somesoni2) is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=updtr_api earliest=-15d updatesearch | rex field=summary "(?\{.*)" | spath input=json_data |stats count by asset_data{}.id | rename asset_data{}.id  as id|eventstats sum(count) as total| eval percentage=round(count*100/total) |table id count percentage
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 19:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-show-the-count-and-percentage-per-id/m-p/287939#M87161</guid>
      <dc:creator>guillecasco</dc:creator>
      <dc:date>2016-04-12T19:49:46Z</dc:date>
    </item>
  </channel>
</rss>

