<?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 How to convert to multivalue field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-to-multivalue-field/m-p/616749#M214352</link>
    <description>&lt;P&gt;I'm trying to convert a field with multiple results into a multivalue field.&lt;/P&gt;
&lt;P&gt;I'm querying a host lookup table that has several hostnames. I'd like to create a single multivalue field containing all the hostnames returned by the inputlookup command separated by a comma. I'm using the makemv command to do this but it returns each host as a separate result instead of a single result with all the hosts separated by commas.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;here's my query:&lt;/P&gt;
&lt;P&gt;| inputlookup host_table&lt;/P&gt;
&lt;P&gt;fields hostname&lt;BR /&gt;| makemv delim="," hostname&lt;/P&gt;
&lt;P&gt;| table hostname&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 00:26:20 GMT</pubDate>
    <dc:creator>pc1234</dc:creator>
    <dc:date>2022-10-12T00:26:20Z</dc:date>
    <item>
      <title>How to convert to multivalue field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-to-multivalue-field/m-p/616749#M214352</link>
      <description>&lt;P&gt;I'm trying to convert a field with multiple results into a multivalue field.&lt;/P&gt;
&lt;P&gt;I'm querying a host lookup table that has several hostnames. I'd like to create a single multivalue field containing all the hostnames returned by the inputlookup command separated by a comma. I'm using the makemv command to do this but it returns each host as a separate result instead of a single result with all the hosts separated by commas.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;
&lt;P&gt;here's my query:&lt;/P&gt;
&lt;P&gt;| inputlookup host_table&lt;/P&gt;
&lt;P&gt;fields hostname&lt;BR /&gt;| makemv delim="," hostname&lt;/P&gt;
&lt;P&gt;| table hostname&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 00:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-to-multivalue-field/m-p/616749#M214352</guid>
      <dc:creator>pc1234</dc:creator>
      <dc:date>2022-10-12T00:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: convert to multivalue field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-to-multivalue-field/m-p/616751#M214354</link>
      <description>&lt;P&gt;First, please clarify that you want a comma-delimited string as output, not a multivalue field. &amp;nbsp;Is this correct? &amp;nbsp;to get a true multivalue field, use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup host_table
| stats values(hostname) as hostname&lt;/LI-CODE&gt;&lt;P&gt;To get one comma-separated text string, do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup host_table
| stats values(hostname) as hostname
| eval hostname = mvjoin(hostname, ",")&lt;/LI-CODE&gt;&lt;P&gt;This latter output will be single-valued.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 23:32:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-to-multivalue-field/m-p/616751#M214354</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-11T23:32:56Z</dc:date>
    </item>
  </channel>
</rss>

