<?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 combine wildcard results into one field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301425#M90758</link>
    <description>&lt;P&gt;Is this bad?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats avg("*Processor Time")  as "*Processor Time" by host 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Jan 2018 02:37:38 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2018-01-11T02:37:38Z</dc:date>
    <item>
      <title>How to combine wildcard results into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301423#M90756</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=perfmonitor sourcetype=dc_perfmonitor source="f:*"  
| fields + host, "*Processor Time"   
| stats avg("*Processor Time") by host 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The output of this query results in a long list of hosts with a staggered table of the average of each machine's average total processor time. I wanted to combine all of these results into a single column. &lt;/P&gt;

&lt;P&gt;Basically, I wanted to ask how do I create a new field using this wildcard search (it has a space in its name), as something more general, like "ProcessorTime" vs. "Machine1 Processor Time", "Machine2 Processor Time", "Machine3 Processor Time", etc.?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301423#M90756</guid>
      <dc:creator>splunklearner9</dc:creator>
      <dc:date>2018-01-10T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine wildcard results into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301424#M90757</link>
      <description>&lt;P&gt;You can do this with foreach, but you definitely want to strongly consider if it's the best solution.&lt;/P&gt;

&lt;P&gt;Here's a run anywhere example of this in action:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval field1="10", field2="20"
| foreach field* [eval fields=mvappend(fields, '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| stats avg(fields)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And your search may look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=perfmonitor sourcetype=dc_perfmonitor source="f:*"  
 | fields + host, "*Processor Time" 
 | foreach "*Processor Time" [eval all_processor_times=mvappend(all_processor_times, '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
 | stats avg(all_processor_times) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may want to include some more details about your source data to help determine if there's a more appropriate way to accomplish what you're looking for.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 02:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301424#M90757</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-11T02:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine wildcard results into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301425#M90758</link>
      <description>&lt;P&gt;Is this bad?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats avg("*Processor Time")  as "*Processor Time" by host 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 02:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301425#M90758</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-01-11T02:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine wildcard results into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301426#M90759</link>
      <description>&lt;P&gt;This worked perfectly. Thanks! Never thought to do it like that.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 22:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-wildcard-results-into-one-field/m-p/301426#M90759</guid>
      <dc:creator>splunklearner9</dc:creator>
      <dc:date>2018-01-11T22:16:21Z</dc:date>
    </item>
  </channel>
</rss>

