<?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: timechart plotting for top entity based on sorting in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651028#M225090</link>
    <description>&lt;P&gt;Add&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where Entity="B" OR Entity="D"&lt;/LI-CODE&gt;&lt;P&gt;to the end of your search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2023 15:57:46 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-07-18T15:57:46Z</dc:date>
    <item>
      <title>How to create a search for timechart plotting for top entity based on sorting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651022#M225087</link>
      <description>&lt;P&gt;Hi i have a table where i obtained the values after sorting PCT_FREE in ascending order now i want to plot a timechart of avg of used_space only for first two entity "B" AND "D" however when i plot timechart it takes all the entity&amp;nbsp; any suggestions on how can i exclude then rest of the entity and plot the timechart&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="511"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="232"&gt;time&lt;/TD&gt;
&lt;TD width="112"&gt;PCT_FREE&lt;/TD&gt;
&lt;TD width="103"&gt;USED_SPACE&lt;/TD&gt;
&lt;TD width="64"&gt;Entity&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;17/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;10.4&lt;/TD&gt;
&lt;TD&gt;245&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;/TR&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/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;233&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;15/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;235&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;232&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;17/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;14&lt;/TD&gt;
&lt;TD&gt;245&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;16/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;14&lt;/TD&gt;
&lt;TD&gt;233&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;15/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;14&lt;/TD&gt;
&lt;TD&gt;235&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;14/07/2023 16:15&lt;/TD&gt;
&lt;TD&gt;14&lt;/TD&gt;
&lt;TD&gt;232&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 24 Jul 2023 17:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651022#M225087</guid>
      <dc:creator>venky1544</dc:creator>
      <dc:date>2023-07-24T17:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: timechart plotting for top entity based on sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651028#M225090</link>
      <description>&lt;P&gt;Add&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where Entity="B" OR Entity="D"&lt;/LI-CODE&gt;&lt;P&gt;to the end of your search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 15:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651028#M225090</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-07-18T15:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: timechart plotting for top entity based on sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651777#M225302</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 for the reply but what if these values always change every day sometime entity A or C might be top&amp;nbsp; i don't specifically want to hardcode the names&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 14:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651777#M225302</guid>
      <dc:creator>vk1544</dc:creator>
      <dc:date>2023-07-24T14:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search for timechart plotting for top entity based on sorting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651853#M225326</link>
      <description>&lt;P&gt;This is very similar to another recent question. &amp;nbsp;My way to cheat that out was to use the ASCII values of numeric numbers (after proper padding) in eventstats. &amp;nbsp;There I used the traditional join-split trick. &amp;nbsp;If your instance is 8.0 and above, however, a little efficiency can be gained by using JSON functions, like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats avg(PCT_FREE) as avg_FREE by Entity
| eval FREE_Entity = json_object("FREE", tostring(round(avg_FREE, 2)), "Entity", Entity)
| eventstats values(FREE_Entity) as FREE_Entity
| eval bottom_Entity = mvappend(json_extract(mvindex(FREE_Entity, 0), "Entity"), json_extract(mvindex(FREE_Entity, 1), "Entity"))
| where Entity IN (bottom_Entity)&lt;/LI-CODE&gt;&lt;P&gt;Note&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I used avg in eventstats because the only way your sorting will make practical sense in the requirement is either the real comparison is sort by avg or by total. &amp;nbsp;If it is total, use sum instead of avg.&lt;/LI&gt;&lt;LI&gt;This method does not depend on presorting the entries. &amp;nbsp;Given that you only want two of bottom counts, you can go without sorting, or sort afterward when there are fewer rows.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 25 Jul 2023 08:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/651853#M225326</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-25T08:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: timechart plotting for top entity based on sorting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/653342#M225792</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/198666"&gt;@vk1544&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/137142"&gt;@venky1544&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, I didn't read your question well - you want the top two Enities, whatever they happen to be.&lt;/P&gt;&lt;P&gt;A simple way to do this is using the last 3 lines of this example search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="time	PCT_FREE	USED_SPACE	Entity
17/07/2023 16:15	10.4	245	B
16/07/2023 16:15	10.5	233	B
15/07/2023 16:15	10.3	235	B
14/07/2023 16:15	10.6	232	B
17/07/2023 16:15	11	245	D
16/07/2023 16:15	11	233	D
15/07/2023 16:15	11	235	D
14/07/2023 16:15	11	232	D
17/07/2023 16:15	12	245	A
16/07/2023 16:15	12	233	A
15/07/2023 16:15	12	235	A
14/07/2023 16:15	12	232	A
17/07/2023 16:15	14	245	C
16/07/2023 16:15	14	233	C
15/07/2023 16:15	14	235	C
14/07/2023 16:15	14	232	C"
| multikv forceheader=1
| table time PCT* USED* Entity
``` The above creates your example data set ```
| streamstats values(Entity) as entities
| where mvcount(entities)&amp;lt;=2
| fields - entities&lt;/LI-CODE&gt;&lt;P&gt;The streamstats collects the different values of Entity to a new field called entities, then the where clause just removes all where the number of values is &amp;lt;= 2, leaving you with the higest two Entity values. Finally the fields statement removes that extra field.&lt;/P&gt;&lt;P&gt;May be a bit late, but hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Aug 2023 23:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-for-timechart-plotting-for-top-entity/m-p/653342#M225792</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-06T23:54:29Z</dc:date>
    </item>
  </channel>
</rss>

