<?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: show multiple fields in table after using a mvexpand in a query in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430954#M40999</link>
    <description>&lt;P&gt;The problem is that the &lt;CODE&gt;rare&lt;/CODE&gt; command returns only the relevant fields.  &lt;/P&gt;

&lt;P&gt;Here's one way &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data sourcetype=stuff 
| mvexpand products 
| appendpipe [| rare limit=10 products | eval myflag="keepme"]
| stats count AS total values(myflag) as myflag values(country) as country by products, name 
| where myflag="keepme"
| fields - myflag
| eval total = total - 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The last line is subtracting the 1 record added by the &lt;CODE&gt;appendpipe&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Aug 2018 15:19:37 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2018-08-27T15:19:37Z</dc:date>
    <item>
      <title>show multiple fields in table after using a mvexpand in a query</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430953#M40998</link>
      <description>&lt;P&gt;Hi I am looking at data which includes a field with multiple lines of values. For instance:&lt;/P&gt;

&lt;P&gt;$name$, $products$, $country$&lt;/P&gt;

&lt;P&gt;============================&lt;/P&gt;

&lt;P&gt;an example of an event:&lt;/P&gt;

&lt;P&gt;name:&lt;BR /&gt;
Peter Thompson&lt;/P&gt;

&lt;P&gt;products:&lt;BR /&gt;
windows 10&lt;BR /&gt;
office 2017&lt;BR /&gt;
adobe reader 9&lt;/P&gt;

&lt;P&gt;country:&lt;BR /&gt;
Germany&lt;/P&gt;

&lt;P&gt;============================&lt;/P&gt;

&lt;P&gt;What I am trying to achieve is a table like:&lt;BR /&gt;
name                          products                  country&lt;BR /&gt;
Peter Thompson     Windows 10           Germany&lt;BR /&gt;
Peter Thompson     Office 2017            Germany&lt;BR /&gt;
Peter Thompson     Adobe Reader 9    Germany&lt;/P&gt;

&lt;P&gt;============================&lt;/P&gt;

&lt;P&gt;To do this I am using mvexpand on the products field which gives me the separated products and sorts them by rarity. I cannot however seem to create a table after that which pulls back the other values such as the name and country. It appears that after the mvexpand or the rare functions, all other fields are lost.&lt;/P&gt;

&lt;P&gt;============================&lt;/P&gt;

&lt;P&gt;My query:&lt;/P&gt;

&lt;P&gt;index=data sourcetype=stuff | mvexpand products | rare limit=10 products | eventstats count AS total by products, name | table count, name&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 02:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430953#M40998</guid>
      <dc:creator>fsiemons</dc:creator>
      <dc:date>2018-08-27T02:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple fields in table after using a mvexpand in a query</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430954#M40999</link>
      <description>&lt;P&gt;The problem is that the &lt;CODE&gt;rare&lt;/CODE&gt; command returns only the relevant fields.  &lt;/P&gt;

&lt;P&gt;Here's one way &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data sourcetype=stuff 
| mvexpand products 
| appendpipe [| rare limit=10 products | eval myflag="keepme"]
| stats count AS total values(myflag) as myflag values(country) as country by products, name 
| where myflag="keepme"
| fields - myflag
| eval total = total - 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The last line is subtracting the 1 record added by the &lt;CODE&gt;appendpipe&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 15:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430954#M40999</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-27T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple fields in table after using a mvexpand in a query</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430955#M41000</link>
      <description>&lt;P&gt;Thank you. I have tried that. Unfortunately whatever gets a "keepme" flag still looses all the other field values along the way...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 00:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430955#M41000</guid>
      <dc:creator>fsiemons</dc:creator>
      <dc:date>2018-08-28T00:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: show multiple fields in table after using a mvexpand in a query</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430956#M41001</link>
      <description>&lt;P&gt;Hi @fsiemons,&lt;/P&gt;

&lt;P&gt;Sorry the above answer didn't answer your question. I'm sure help is on the way!&lt;/P&gt;

&lt;P&gt;But, in the mean time,If you want to try to get some immediate help for your question, you should join the 5000+ Splunk users in our public Slack Community chat. People ask each other for immediate help on there daily. You can share your question/link to your post there to see if anyone can take a stab at it.&lt;/P&gt;

&lt;P&gt;You first have to request access through &lt;A href="https://splk.it/slack"&gt;https://splk.it/slack&lt;/A&gt; Fill out the form, and once you receive the approval email from our Community Manager (usually the approval process may take a couple days), you can access Slack.com and ask for help in the #general channel.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 23:39:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/show-multiple-fields-in-table-after-using-a-mvexpand-in-a-query/m-p/430956#M41001</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-08-28T23:39:19Z</dc:date>
    </item>
  </channel>
</rss>

