<?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 Substituting host and source data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Substituting-host-and-source-data/m-p/562103#M195488</link>
    <description>&lt;P&gt;Hello - I am using the following two searches:&lt;BR /&gt;&lt;BR /&gt;The first search is creating a table consisting of _time, idx, and b.&amp;nbsp; There are two other fields available, s for source and h for host.&amp;nbsp; However, we squash this information for performance reasons.&lt;BR /&gt;&lt;BR /&gt;index=_internal sourcetype=splunkd type=Usage source=*license_usage.log&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes&lt;BR /&gt;&lt;BR /&gt;I have been trying to figure out a way to substitute the s &amp;amp; h data in the events by using a join, append, or appendcols using:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE index=* sourcetype=* source=* unit_id=* by index, sourcetype, source, host, dept&lt;BR /&gt;| table index, sourcetype, source,&amp;nbsp; host, dept&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;Join Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| join type=inner index&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;Append Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| append&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;AppendCols Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| appendcols&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Results:&lt;BR /&gt;&lt;BR /&gt;join: just fails with no data&lt;BR /&gt;append: the _time and bytes fields are blank&lt;BR /&gt;appendcols: leaves out the _time field - which I need to create timecharts with.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;The end result should look like this:&lt;BR /&gt;&lt;BR /&gt;_time&amp;nbsp; index&amp;nbsp; &amp;nbsp;sourcetype&amp;nbsp; &amp;nbsp;source&amp;nbsp; &amp;nbsp;host&amp;nbsp; &amp;nbsp;dept&amp;nbsp; &amp;nbsp;bytes&lt;BR /&gt;&lt;BR /&gt;where _time, index, bytes comes from the _internal logs&lt;BR /&gt;where index, sourcetype, source, host, dept comes from the | tstats logs&lt;BR /&gt;&lt;BR /&gt;Any help is greatly appreciated.&amp;nbsp; Thank you.&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 04 Aug 2021 15:23:43 GMT</pubDate>
    <dc:creator>jason_hotchkiss</dc:creator>
    <dc:date>2021-08-04T15:23:43Z</dc:date>
    <item>
      <title>Substituting host and source data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Substituting-host-and-source-data/m-p/562103#M195488</link>
      <description>&lt;P&gt;Hello - I am using the following two searches:&lt;BR /&gt;&lt;BR /&gt;The first search is creating a table consisting of _time, idx, and b.&amp;nbsp; There are two other fields available, s for source and h for host.&amp;nbsp; However, we squash this information for performance reasons.&lt;BR /&gt;&lt;BR /&gt;index=_internal sourcetype=splunkd type=Usage source=*license_usage.log&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes&lt;BR /&gt;&lt;BR /&gt;I have been trying to figure out a way to substitute the s &amp;amp; h data in the events by using a join, append, or appendcols using:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE index=* sourcetype=* source=* unit_id=* by index, sourcetype, source, host, dept&lt;BR /&gt;| table index, sourcetype, source,&amp;nbsp; host, dept&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;Join Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| join type=inner index&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;Append Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| append&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;AppendCols Example:&lt;BR /&gt;&lt;BR /&gt;| tstats count WHERE sourcetype=* source=* host=* unit_id=* by index sourcetype source host dept&lt;BR /&gt;| table index sourcetype source host dept&lt;BR /&gt;| appendcols&lt;BR /&gt;[ search index=_internal sourcetype=splunkd type=Usage source="/opt/splunk/var/log/splunk/license_usage.log"&lt;BR /&gt;| table _time idx b&lt;BR /&gt;| rename idx as index, b as bytes]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Results:&lt;BR /&gt;&lt;BR /&gt;join: just fails with no data&lt;BR /&gt;append: the _time and bytes fields are blank&lt;BR /&gt;appendcols: leaves out the _time field - which I need to create timecharts with.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;The end result should look like this:&lt;BR /&gt;&lt;BR /&gt;_time&amp;nbsp; index&amp;nbsp; &amp;nbsp;sourcetype&amp;nbsp; &amp;nbsp;source&amp;nbsp; &amp;nbsp;host&amp;nbsp; &amp;nbsp;dept&amp;nbsp; &amp;nbsp;bytes&lt;BR /&gt;&lt;BR /&gt;where _time, index, bytes comes from the _internal logs&lt;BR /&gt;where index, sourcetype, source, host, dept comes from the | tstats logs&lt;BR /&gt;&lt;BR /&gt;Any help is greatly appreciated.&amp;nbsp; Thank you.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 04 Aug 2021 15:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Substituting-host-and-source-data/m-p/562103#M195488</guid>
      <dc:creator>jason_hotchkiss</dc:creator>
      <dc:date>2021-08-04T15:23:43Z</dc:date>
    </item>
  </channel>
</rss>

