<?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: help on append command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385413#M173092</link>
    <description>&lt;P&gt;which index I have to add in count(eval(index=x))??&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 14:21:19 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-02-12T14:21:19Z</dc:date>
    <item>
      <title>help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385408#M173087</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;The request below count a number of error events by host&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
| dedup host
| stats count(host) as host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to match this count with the serach below in order to have the number of error events by model&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
| dedup host 
| append 
    [ search index="aix" sourcetype="x" 
    | rex "Model=(?&amp;lt;model&amp;gt;.*)" ] 
| stats values(model) as Model by host 
| stats count(host) as host by Model 
| dedup host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I do this but it doesn't returns the same number of events that there is in the first search&lt;BR /&gt;
So my request is not good....&lt;BR /&gt;
Could you help me on this append command please???&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 08:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385408#M173087</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-12T08:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385409#M173088</link>
      <description>&lt;P&gt;First of all, your first search does NOT &lt;CODE&gt;count number of error events by host&lt;/CODE&gt;, but this does:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
| stats count BY host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To show the number of error events by model, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="x" sourcetype="x" ConfigManagerErrorCode=28) OR (index="aix" sourcetype="x")
| rex "Model=(?&amp;lt;model&amp;gt;.*)"
| stats values(model) AS Model count(eval(index=x)) AS count BY host
| mvexpand Model
| stats sum(count) AS count BY Model
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 09:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385409#M173088</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-12T09:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385410#M173089</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;OK for :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
| stats count BY host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but if I want to have the result (five events) in a single value what i have to do&lt;/P&gt;

&lt;P&gt;concerning :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index="x" sourcetype="x" ConfigManagerErrorCode=28) OR (index="aix" sourcetype="x")
2. | rex "Model=(?&amp;lt;model&amp;gt;.*)"
3. | stats values(model) AS Model count(eval(index=x)) AS count BY host
4. | mvexpand Model
5. | stats sum(count) AS count BY Model
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it doesn't works&lt;BR /&gt;
I have more than 2000 events...&lt;BR /&gt;
if in the request below I have 5 events I need to have also 5 events in the second query but i want the details by model&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="x" sourcetype="x" ConfigManagerErrorCode=28 
| stats count BY host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 09:55:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385410#M173089</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-12T09:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385411#M173090</link>
      <description>&lt;P&gt;when I do this its almost what i want but it seems to count not the number of host by model but only to count each model (so I have always model=a =1, model b=1, model c=1)&lt;/P&gt;

&lt;P&gt;(index="x" sourcetype="WMI:PeriphIssue" ConfigManagerErrorCode=28) &lt;BR /&gt;
| dedup host &lt;BR /&gt;
| append &lt;BR /&gt;
    [ search index="x" sourcetype="WMI:ModelPC" NOT host=E* &lt;BR /&gt;
    | rex "Model=(?&lt;MODEL&gt;.*)" &lt;BR /&gt;
    | stats values(model) as Model by host ] &lt;BR /&gt;
| stats count(host) as host by Model&lt;/MODEL&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 10:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385411#M173090</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-12T10:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385412#M173091</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
 | stats dc(host) as host 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for getting hosts &lt;/P&gt;

&lt;P&gt;and as suggested by woodcock  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="x" sourcetype="x" ConfigManagerErrorCode=28) OR (index="aix" sourcetype="x")
 | rex "Model=(?&amp;lt;model&amp;gt;.*)"
 | stats values(model) AS Model count(eval(index=x)) AS count BY host
 | mvexpand Model
 | stats sum(count) AS count BY Model  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this should work &lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 12:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385412#M173091</guid>
      <dc:creator>nawneel</dc:creator>
      <dc:date>2019-02-12T12:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385413#M173092</link>
      <description>&lt;P&gt;which index I have to add in count(eval(index=x))??&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385413#M173092</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-02-12T14:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: help on append command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385414#M173093</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="x" sourcetype="x" ConfigManagerErrorCode=28 
| stats count BY host
| rename COMMENT AS "The stuff below converts your 5 rows into 1"
| eval hosts="counts"
| xyseries hosts host count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Mar 2019 04:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-append-command/m-p/385414#M173093</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-03T04:37:06Z</dc:date>
    </item>
  </channel>
</rss>

