<?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 create multivalue field from single value fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137649#M37746</link>
    <description>&lt;P&gt;The last part of the query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats list(host) as Server list(operations) as Operations by Environment 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The machines have to be listed by the respective server and then the Operations row by its respective machine.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2015 18:22:53 GMT</pubDate>
    <dc:creator>ohlafl</dc:creator>
    <dc:date>2015-07-24T18:22:53Z</dc:date>
    <item>
      <title>How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137647#M37744</link>
      <description>&lt;P&gt;I have several fields containing machine performance data named as &lt;CODE&gt;CPUload&lt;/CODE&gt; and &lt;CODE&gt;RAMload&lt;/CODE&gt; etcetera. They are dynamically calculated by searches such as &lt;CODE&gt;eval value=if(valueFromSource &amp;amp;gt; 0, "Value is: " "N/A")&lt;/CODE&gt;. These fields are to be concatenated into one row in a table column called "Operations" and the column to the left contains the name of the machine.&lt;/P&gt;

&lt;P&gt;This almost works, but whenever I try to write something that would print this row as:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;CPU load: 5%, RAM load: 10%&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;... it always ends up looking like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;CPU load: 5%,&lt;BR /&gt;
RAM load: 10%,&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;What am I doing wrong? I have tried everything from concatenating strings to multivalue operations, but whatever angle I try, it always turns out the same. I suspect that what I want to do is to create a multivalue field from two single value fields, but I am honestly not sure... any takers on this?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2015 17:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137647#M37744</guid>
      <dc:creator>ohlafl</dc:creator>
      <dc:date>2015-07-24T17:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137648#M37745</link>
      <description>&lt;P&gt;It would be helpful to see the queries you've tried that came close to what you want.&lt;/P&gt;

&lt;P&gt;Have you tried something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval Operations=CPUload.", ".RAMload | table machineName Operations
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jul 2015 18:01:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137648#M37745</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-24T18:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137649#M37746</link>
      <description>&lt;P&gt;The last part of the query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats list(host) as Server list(operations) as Operations by Environment 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The machines have to be listed by the respective server and then the Operations row by its respective machine.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2015 18:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137649#M37746</guid>
      <dc:creator>ohlafl</dc:creator>
      <dc:date>2015-07-24T18:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137650#M37747</link>
      <description>&lt;P&gt;You need to do something like this (building your magastring &lt;EM&gt;before&lt;/EM&gt; the &lt;CODE&gt;stats&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval operations="host=" . host . ", CPUload=" . CPUload . ", RAMload=" . RAMload . ", SomeValue=" . if(valueFromSource&amp;lt;0, valueFromSource, "N/A") | stats list(operations) as Operations by Environment
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jul 2015 20:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137650#M37747</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-24T20:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137651#M37748</link>
      <description>&lt;P&gt;Just add following to end of your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...Your current search ....| nomv Operations
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jul 2015 21:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137651#M37748</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-24T21:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multivalue field from single value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137652#M37749</link>
      <description>&lt;P&gt;This would of worked if there was only one machine per environment but since there can up to four of them this happened:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CPU load: 5%, RAM load: 10%, Some Value: 4%, CPU load: 5%, RAM load: 10%, Some Value: 4%, CPU load: 5%, RAM load: 10%, Some Value: 4%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Everything on one row instead of:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CPU load: 56%, RAM load: 10%, Some Value: 23%, 
CPU load: 3%, RAM load: 15%, Some Value: 42%, 
CPU load: 1%, RAM load: 1%, Some Value: 46%, 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;One row with three results per machine. Is this expected or have I done something wrong? I tried running &lt;CODE&gt;makemv delim="," Operations| eval Operations=mvappend(CPUStatus, MemStatus)&lt;/CODE&gt; etcetera but the result was the same.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jul 2015 11:04:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-multivalue-field-from-single-value-fields/m-p/137652#M37749</guid>
      <dc:creator>ohlafl</dc:creator>
      <dc:date>2015-07-25T11:04:04Z</dc:date>
    </item>
  </channel>
</rss>

