<?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 group by a field and display multiple fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-a-field-and-display-multiple-fields/m-p/489590#M136733</link>
    <description>&lt;P&gt;I have trace, level, and message fields in my events. I want to group by trace, and I also want to display all other fields. I'm having issues with multiple fields lining up when they have different amount of lines.&lt;/P&gt;

&lt;P&gt;Here's what I want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+--------+-------+----------+
| trace1 | INFO  | Message1 |
|        |       | Line2    |
|        +-------+----------+
|        | DEBUG | Message2 |
|        +-------+----------+
|        | DEBUG | Message3 |
+--------+-------+----------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I end up with results like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+--------+-------+----------+
| trace1 | INFO  | Message1 |
|        +-------+ Line2    |
|        | DEBUG |          |
|        +-------+----------+
|        | DEBUG | Message2 |
|        +-------+----------+
|        |       | Message3 |
+--------+-------+----------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's my search query:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;| stats list(level), list(message) by trace&lt;/LI&gt;
&lt;/UL&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 24 Sep 2019 18:52:35 GMT</pubDate>
    <dc:creator>andytangjpmc</dc:creator>
    <dc:date>2019-09-24T18:52:35Z</dc:date>
    <item>
      <title>How to group by a field and display multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-a-field-and-display-multiple-fields/m-p/489590#M136733</link>
      <description>&lt;P&gt;I have trace, level, and message fields in my events. I want to group by trace, and I also want to display all other fields. I'm having issues with multiple fields lining up when they have different amount of lines.&lt;/P&gt;

&lt;P&gt;Here's what I want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+--------+-------+----------+
| trace1 | INFO  | Message1 |
|        |       | Line2    |
|        +-------+----------+
|        | DEBUG | Message2 |
|        +-------+----------+
|        | DEBUG | Message3 |
+--------+-------+----------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I end up with results like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+--------+-------+----------+
| trace1 | INFO  | Message1 |
|        +-------+ Line2    |
|        | DEBUG |          |
|        +-------+----------+
|        | DEBUG | Message2 |
|        +-------+----------+
|        |       | Message3 |
+--------+-------+----------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's my search query:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;| stats list(level), list(message) by trace&lt;/LI&gt;
&lt;/UL&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 18:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-a-field-and-display-multiple-fields/m-p/489590#M136733</guid>
      <dc:creator>andytangjpmc</dc:creator>
      <dc:date>2019-09-24T18:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to group by a field and display multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-a-field-and-display-multiple-fields/m-p/489591#M136734</link>
      <description>&lt;P&gt;Multiple level grouping (similar to merging columns in Excel) is not supported natively. For your requirement, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..| stats list(message) by trace level
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval Level_message=level."  ##  ".message | stats list(Level_message) by trace
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 20:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-by-a-field-and-display-multiple-fields/m-p/489591#M136734</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-09-24T20:19:05Z</dc:date>
    </item>
  </channel>
</rss>

