<?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: Storing the correct host dimension with mcollect in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/563800#M100423</link>
    <description>&lt;P&gt;I never came up with a solution. I stopped using mcollect and now use the Summary Indexing feature with Metrics index type, which I believe requires Splunk 8.1.&lt;/P&gt;&lt;P&gt;For some reason I never setup any metrics to use a host dimension, but perhaps this feature preserves it. I believe something like this would work, or at least it's worth a shot:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype=mysourcetype host=* "Events to count"
| timechart limit=0 span=1m count by host
| untable _time host "My.Metric.Name"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 15:25:56 GMT</pubDate>
    <dc:creator>JustinSC</dc:creator>
    <dc:date>2021-08-18T15:25:56Z</dc:date>
    <item>
      <title>Storing the correct host dimension with mcollect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/541066#M90549</link>
      <description>&lt;P&gt;I've got some events I'm converting to metrics using mcollect with a scheduled report. Does anyone know how to get the metrics to store the original host from the logs instead of whichever indexer they get sent to?&lt;/P&gt;&lt;P&gt;This is the query I'm using to populate the metrics:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype=mysourcetype host=* "Events to count"
| bin _time span=1m
| stats count AS _value BY _time, host
| eval metric_name="My.Metric.Name"
| mcollect index="prod_metrics"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The host field in the metrics ends up being a random indexer from our cluster. I know I could always rename host as server, but if possible I'd like to use the expected field name since all our other natively populated metrics are by host.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 18:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/541066#M90549</guid>
      <dc:creator>JustinSC</dc:creator>
      <dc:date>2021-02-23T18:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Storing the correct host dimension with mcollect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/563768#M100416</link>
      <description>&lt;P&gt;Same problem her.&lt;BR /&gt;Tried everything:&lt;/P&gt;&lt;P&gt;host=host&lt;/P&gt;&lt;P&gt;host=$host$&lt;/P&gt;&lt;P&gt;host={host}&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 12:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/563768#M100416</guid>
      <dc:creator>andreasz</dc:creator>
      <dc:date>2021-08-18T12:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Storing the correct host dimension with mcollect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/563800#M100423</link>
      <description>&lt;P&gt;I never came up with a solution. I stopped using mcollect and now use the Summary Indexing feature with Metrics index type, which I believe requires Splunk 8.1.&lt;/P&gt;&lt;P&gt;For some reason I never setup any metrics to use a host dimension, but perhaps this feature preserves it. I believe something like this would work, or at least it's worth a shot:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype=mysourcetype host=* "Events to count"
| timechart limit=0 span=1m count by host
| untable _time host "My.Metric.Name"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 15:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Storing-the-correct-host-dimension-with-mcollect/m-p/563800#M100423</guid>
      <dc:creator>JustinSC</dc:creator>
      <dc:date>2021-08-18T15:25:56Z</dc:date>
    </item>
  </channel>
</rss>

