<?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: Adding host field when summary indexing? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82484#M17083</link>
    <description>&lt;P&gt;did you try adding:&lt;/P&gt;

&lt;P&gt;| fields host&lt;/P&gt;

&lt;P&gt;in you search?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2011 15:18:58 GMT</pubDate>
    <dc:creator>MarioM</dc:creator>
    <dc:date>2011-04-15T15:18:58Z</dc:date>
    <item>
      <title>Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82483#M17082</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a heavy search on multiple sources that I want to schedule to populate a summary index. I am basically interested in certain events so I want to populate the summary index with only those events. That way I can run searches on the summary index quickly as opposed to the normal index that contains hundreds of millions of events.&lt;/P&gt;

&lt;P&gt;I can populate the summary index like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows OR index=linux OR index=something my search | addinfo | collect index=mysummaryindex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works fine, however the problem is that the host field is not saved so I don't know which host generated the event.&lt;/P&gt;

&lt;P&gt;Is there a way to add the host field into the summary index as well? The marker option for collect just adds a certain string field which is not useful in this case.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 13:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82483#M17082</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2011-04-15T13:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82484#M17083</link>
      <description>&lt;P&gt;did you try adding:&lt;/P&gt;

&lt;P&gt;| fields host&lt;/P&gt;

&lt;P&gt;in you search?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 15:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82484#M17083</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2011-04-15T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82485#M17084</link>
      <description>&lt;P&gt;Yes, unfortunately that field does not get stored in the summary index.&lt;/P&gt;

&lt;P&gt;It appears that the collect command only stores what's in the marker, and that can be only an arbitrary string.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 17:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82485#M17084</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2011-04-15T17:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82486#M17085</link>
      <description>&lt;P&gt;When writing to the summary index Splunk should have created and populated the original host in a new field "orig_host".&lt;/P&gt;

&lt;P&gt;Does that not exist?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 21:00:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82486#M17085</guid>
      <dc:creator>ualbanytech</dc:creator>
      <dc:date>2011-04-15T21:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82487#M17086</link>
      <description>&lt;P&gt;Nope - I don't see the orig_host field at all. I'm not sure if the collect command adds that, or it is only part of sistat/sichart/etc commands.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 21:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82487#M17086</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2011-04-15T21:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82488#M17087</link>
      <description>&lt;P&gt;Oh, yah. I see what you're saying. I was using stat command.&lt;BR /&gt;
I'm trying to do something similar but, &lt;A href="http://splunk-base.splunk.com/answers/13721/summary-indexing-created-multi-value-in-orig_host-entries"&gt;I additionally want to eliminate unwanted fields when I write to summary&lt;/A&gt; but, no answer for me so far:&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2011 21:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82488#M17087</guid>
      <dc:creator>ualbanytech</dc:creator>
      <dc:date>2011-04-15T21:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82489#M17088</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;# I was having trouble recording the raw event, original host, sourcetype and source fields and putting them into a summary index as they were always overridden with the values of the host which runs the search populating the summary index - here's one solution

# step 1 - populate summary index
# search events from an index namded "other" and prepend the _time, host, sourcetype and source fields to the _raw field with "|" as a delimeter and put into a summary index named "collect"
index=other | eval _raw=_time+"|"+host+"|"+sourcetype+"|"+source+"|"+_raw | collect index=collect

# step 2 - read from summary index named "collect"
# extract time, host, sourcetype and source fields that are stashed in the _raw field in the summary index named "collect"
index=collect | rex "^(?&amp;lt;time1&amp;gt;[^|]+)\|(?&amp;lt;host1&amp;gt;[^|]+)\|(?&amp;lt;sourcetype1&amp;gt;[^|]+)\|(?&amp;lt;source1&amp;gt;[^|]+)\|(?&amp;lt;raw1&amp;gt;[^|]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2013 06:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82489#M17088</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-10-21T06:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82490#M17089</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;# a much simpler solution that I got from Splunk guru "D" :-)
# turns out renaming the _raw field corrects the issue of missing some of the "orig" fields, i.e. orig_sourcetype
# this approach is proabaly not as relavant to Splunk 6 which has many automatic acceleration features
# note: the "| collect " command is optional not needed if you are using the summary index checkbox in a saved search
index=other | rename _time as time | rename _raw as raw | stats count by time raw index host sourcetype source | collect index=collect
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2013 18:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82490#M17089</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-10-21T18:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding host field when summary indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82491#M17090</link>
      <description>&lt;P&gt;after further testing, this is my favorite solution&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Just add the following after your base search and orig_host, orig_sourcetype, orig_source and orig_index will all be in your summary index :-)

 | rename _raw as orig_raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2013 21:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-host-field-when-summary-indexing/m-p/82491#M17090</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-10-21T21:33:41Z</dc:date>
    </item>
  </channel>
</rss>

