<?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 count field values from two indexes and plot this on a graph? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230806#M68438</link>
    <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index=report) OR(index=fixed) |stats count as total_count by  index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 03 Mar 2016 12:27:48 GMT</pubDate>
    <dc:creator>fdi01</dc:creator>
    <dc:date>2016-03-03T12:27:48Z</dc:date>
    <item>
      <title>How to count field values from two indexes and plot this on a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230803#M68435</link>
      <description>&lt;P&gt;I have 2 indexes: &lt;CODE&gt;index=report&lt;/CODE&gt; and &lt;CODE&gt;index=fixed&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Both have the same field &lt;STRONG&gt;ticket&lt;/STRONG&gt;. When a ticket is reported, it goes in both indexes, but when that ticket is resolved, it just gets removed from fixed index.&lt;/P&gt;

&lt;P&gt;Now I wanted to compare how many tickets where there before January and how many are still remaining and plot them on a graph.&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=report&lt;/CODE&gt; contains:&lt;BR /&gt;
ticket &lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=fixed&lt;/CODE&gt; contains:&lt;BR /&gt;
ticket &lt;BR /&gt;
1&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;/P&gt;

&lt;P&gt;It should give output as:&lt;/P&gt;

&lt;P&gt;total count=5&lt;BR /&gt;
remain=3&lt;/P&gt;

&lt;P&gt;and plot this on a graph.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 11:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230803#M68435</guid>
      <dc:creator>tp92222</dc:creator>
      <dc:date>2016-03-03T11:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to count field values from two indexes and plot this on a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230804#M68436</link>
      <description>&lt;P&gt;hi tp92222,&lt;/P&gt;

&lt;P&gt;i don't understand very well your problem, explain your problem in a simple way and tell us exactly what you want.&lt;/P&gt;

&lt;P&gt;cordially&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 11:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230804#M68436</guid>
      <dc:creator>gyslainlatsa</dc:creator>
      <dc:date>2016-03-03T11:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to count field values from two indexes and plot this on a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230805#M68437</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=report |stats count(ticket) as total_count |appendcols[search index=fixed |stats count(ticket) as remain]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in visualisation tab choose for example Bar chart &lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 12:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230805#M68437</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2016-03-03T12:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to count field values from two indexes and plot this on a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230806#M68438</link>
      <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index=report) OR(index=fixed) |stats count as total_count by  index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2016 12:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230806#M68438</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-03-03T12:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count field values from two indexes and plot this on a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230807#M68439</link>
      <description>&lt;P&gt;Try this base search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=report OR index=fixed | stats dc(index) AS Indices values(*) AS * by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From there you can add any &lt;CODE&gt;where indices ...&lt;/CODE&gt; clause that you like  followed by another &lt;CODE&gt;stats&lt;/CODE&gt; (or &lt;CODE&gt;eventstats&lt;/CODE&gt;) clause to wrap it up.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 00:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-field-values-from-two-indexes-and-plot-this-on-a/m-p/230807#M68439</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-03-04T00:23:46Z</dc:date>
    </item>
  </channel>
</rss>

