<?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: Output multiple multiple field names and values under a single column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428314#M122549</link>
    <description>&lt;P&gt;WOW, this is perfect.&lt;/P&gt;

&lt;P&gt;Thank you Nair!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 13:27:02 GMT</pubDate>
    <dc:creator>claudiuu</dc:creator>
    <dc:date>2018-10-19T13:27:02Z</dc:date>
    <item>
      <title>Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428310#M122545</link>
      <description>&lt;P&gt;Hello guys and girls,&lt;BR /&gt;
I encountered a situation where i need to extract data from two log types that have just 3 common field names and lots of uncommon ones, but all in a table output.&lt;BR /&gt;
So&lt;BR /&gt;
Log1: &lt;BR /&gt;
Name=Name1 &lt;BR /&gt;
Process=Process1&lt;BR /&gt;
Hash=Hash1&lt;BR /&gt;
Uncommon1=Value1 &lt;BR /&gt;
Uncommon2=Value2&lt;/P&gt;

&lt;P&gt;Log2:&lt;BR /&gt;
Name=Name2&lt;BR /&gt;
Process=Process2&lt;BR /&gt;
Hash=Hash2&lt;BR /&gt;
Uncommon3=Value3&lt;BR /&gt;
Uncommon4=Value4&lt;BR /&gt;
Uncommon5=Value5&lt;/P&gt;

&lt;P&gt;The desired output would look like:&lt;BR /&gt;
Name             Process          Hash          Attributes&lt;BR /&gt;
Name1           Process1       Hash1        Uncommon1=Value1&lt;BR /&gt;
                                                                   Uncommon2=Value2&lt;BR /&gt;
Name2           Process2       Hash2        Uncommon3=Value3&lt;BR /&gt;
                                                                   Uncommon4=Value4&lt;BR /&gt;
                                                                   Uncommon5=Value5&lt;/P&gt;

&lt;P&gt;I tried multiple combinations using table and fields but i couldn't figure out how to group the uncommon fields and their values in a single column.&lt;/P&gt;

&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428310#M122545</guid>
      <dc:creator>claudiuu</dc:creator>
      <dc:date>2018-10-17T08:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428311#M122546</link>
      <description>&lt;P&gt;@claudiuu, are these uncommon values have a pattern -like starting with a particular word? If not, how is your  sample event look like? Are these delimited fields or extracted? It would be helpful to see  a sample event.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 14:27:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428311#M122546</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-17T14:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428312#M122547</link>
      <description>&lt;P&gt;Hello Nair,&lt;BR /&gt;
The fields are extracted for each event type. For each event type, they have a similar field name with different values. Two event examples would be:&lt;BR /&gt;
EVENT 1&lt;BR /&gt;
     Agent IP:   &lt;IP_ADDRESS&gt;&lt;BR /&gt;&lt;BR /&gt;
     ComputerName:   &lt;COMPUTER_NAME&gt;&lt;BR /&gt;&lt;BR /&gt;
     ConfigBuild:    1007.3.0007702.1&lt;BR /&gt;&lt;BR /&gt;
     ConfigStateHash_decimal:    2693441101 &lt;BR /&gt;
     ConnectionDirection_decimal:    0&lt;BR /&gt;&lt;BR /&gt;
     ConnectionFlags_decimal:    0&lt;BR /&gt;&lt;BR /&gt;
     ContextProcessId_decimal:   1902826736335&lt;BR /&gt;&lt;BR /&gt;
     ContextThreadId_decimal:    3976186904410882&lt;BR /&gt;&lt;BR /&gt;
     ContextTimeStamp_decimal:   1539660458.789 &lt;BR /&gt;
     EffectiveTransmissionClass_decimal:     3&lt;BR /&gt;&lt;BR /&gt;
     Entitlements_decimal:   15 &lt;BR /&gt;
     InContext_decimal:  0&lt;BR /&gt;&lt;BR /&gt;
     LPort:  49584&lt;BR /&gt;&lt;BR /&gt;
     LocalAddressIP4:    10.110.126.246 &lt;BR /&gt;
     LocalIP:    10.110.126.246 &lt;BR /&gt;
     LocalPort_decimal:  49584&lt;BR /&gt;&lt;BR /&gt;
     MAC:    &lt;MAC_ADDRESS_NIC&gt;&lt;BR /&gt;
     ProductType:    1&lt;BR /&gt;&lt;BR /&gt;
     Protocol_decimal:   6&lt;BR /&gt;&lt;BR /&gt;
     RPort:  60845&lt;BR /&gt;&lt;BR /&gt;
     RemoteAddressIP4:   10.244.76.154&lt;BR /&gt;&lt;BR /&gt;
     RemoteIP:   10.244.76.154&lt;BR /&gt;&lt;BR /&gt;
     RemotePort_decimal:     60845&lt;BR /&gt;&lt;BR /&gt;
     aid:    9b1868e751c84f4272fa22110764f060&lt;BR /&gt;&lt;BR /&gt;
     aip:    185.89.151.81&lt;BR /&gt;&lt;BR /&gt;
     cid:    3d156917ad3b4b3a9d1c6fe67e95db4b&lt;BR /&gt;&lt;BR /&gt;
     company:    &lt;COMPANY&gt;&lt;BR /&gt;&lt;BR /&gt;
     eid:    319&lt;BR /&gt;&lt;BR /&gt;
     esize:  131&lt;BR /&gt;&lt;BR /&gt;
     event_err:  false&lt;BR /&gt;&lt;BR /&gt;
     event_platform:     Win&lt;BR /&gt;&lt;BR /&gt;
     event_simpleName:   NetworkConnectIP4&lt;BR /&gt;&lt;BR /&gt;
     event_version:  5&lt;BR /&gt;&lt;BR /&gt;
     eventtype:  eam&lt;BR /&gt;&lt;BR /&gt;
     host:   localhost:&lt;RANDOM_PORT&gt;&lt;BR /&gt;&lt;BR /&gt;
     id:     4db95d20-d0f3-11e8-a0e9-020f46cbb5d4&lt;BR /&gt;&lt;BR /&gt;
     index:  main&lt;BR /&gt;&lt;BR /&gt;
     name:   NetworkConnectIP4V5&lt;BR /&gt;&lt;BR /&gt;
     source:     main&lt;BR /&gt;&lt;BR /&gt;
     sourcetype:     NetworkConnectIP4V5-v02&lt;BR /&gt;&lt;BR /&gt;
     tid:    2572288&lt;BR /&gt;&lt;BR /&gt;
     timestamp:  1539660403442  &lt;/RANDOM_PORT&gt;&lt;/COMPANY&gt;&lt;/MAC_ADDRESS_NIC&gt;&lt;/COMPUTER_NAME&gt;&lt;/IP_ADDRESS&gt;&lt;/P&gt;

&lt;P&gt;EVENT 2&lt;BR /&gt;
     Agent IP:   &lt;IP_ADDRESS&gt;&lt;BR /&gt;&lt;BR /&gt;
     ComputerName:   &lt;HOSTNAME&gt; &lt;BR /&gt;
     ConfigBuild:    1007.3.0007702.1&lt;BR /&gt;&lt;BR /&gt;
     ConfigStateHash_decimal:    2693441101 &lt;BR /&gt;
     ContextProcessId_decimal:   1902826736335&lt;BR /&gt;&lt;BR /&gt;
     ContextThreadId_decimal:    3981387462596668&lt;BR /&gt;&lt;BR /&gt;
     ContextTimeStamp_decimal:   1539660398.845 &lt;BR /&gt;
     DnsRequestCount_decimal:    1&lt;BR /&gt;&lt;BR /&gt;
     DomainName:     &lt;DOMAIN_NAME&gt;&lt;BR /&gt;&lt;BR /&gt;
     DualRequest_decimal:    0&lt;BR /&gt;&lt;BR /&gt;
     EffectiveTransmissionClass_decimal:     3&lt;BR /&gt;&lt;BR /&gt;
     Entitlements_decimal:   15 &lt;BR /&gt;
     InterfaceIndex_decimal:     0&lt;BR /&gt;&lt;BR /&gt;
     LocalAddressIP4:    172.17.9.182&lt;BR /&gt;&lt;BR /&gt;
     MAC:    &lt;MAC_ADDRESS_NIC&gt;&lt;BR /&gt;&lt;BR /&gt;
     ProductType:    1&lt;BR /&gt;&lt;BR /&gt;
     RequestType_decimal:    1&lt;BR /&gt;&lt;BR /&gt;
     aid:    9b1868e751c84f4272fa22110764f060&lt;BR /&gt;&lt;BR /&gt;
     aip:    185.89.151.81&lt;BR /&gt;&lt;BR /&gt;
     cid:    3d156917ad3b4b3a9d1c6fe67e95db4b&lt;BR /&gt;&lt;BR /&gt;
     company:    &lt;COMPANY&gt;&lt;BR /&gt;&lt;BR /&gt;
     eid:    382&lt;BR /&gt;&lt;BR /&gt;
     esize:  125&lt;BR /&gt;&lt;BR /&gt;
     event_err:  false&lt;BR /&gt;&lt;BR /&gt;
     event_platform:     Win&lt;BR /&gt;&lt;BR /&gt;
     event_simpleName:   DnsRequest &lt;BR /&gt;
     event_version:  3&lt;BR /&gt;&lt;BR /&gt;
     host:   localhost:&lt;RANDOM_PORT&gt;&lt;BR /&gt;&lt;BR /&gt;
     id:     4db95e6b-d0f3-11e8-a0e9-020f46cbb5d4&lt;BR /&gt;&lt;BR /&gt;
     index:  main&lt;BR /&gt;&lt;BR /&gt;
     name:   DnsRequestV3&lt;BR /&gt;&lt;BR /&gt;
     source:     main&lt;BR /&gt;&lt;BR /&gt;
     sourcetype:     DnsRequestV3-v02&lt;BR /&gt;&lt;BR /&gt;
     tid:    2572544&lt;BR /&gt;&lt;BR /&gt;
     timestamp:  1539660403442  &lt;/RANDOM_PORT&gt;&lt;/COMPANY&gt;&lt;/MAC_ADDRESS_NIC&gt;&lt;/DOMAIN_NAME&gt;&lt;/HOSTNAME&gt;&lt;/IP_ADDRESS&gt;&lt;/P&gt;

&lt;P&gt;My initial query would look like:&lt;BR /&gt;
 ContextProcessId_decimal:1902826736335| table _time event_simpleName FileName CommandLine UserName DomainName SourceFileName TargetFileName RemoteAddressIP4 RemotePort_decimal LocalPort_decimal CommandLineParameters RegObjectName RegStringValue RegValueName ServiceDescription ServiceDisplayName ServiceImagePath ServiceStart_decimal ImageFileName InjectedDll SourceThreadModule TaskName TaskExecCommand TaskExecArguments | sort + _time &lt;/P&gt;

&lt;P&gt;I would like that the output table to contain the columns:&lt;BR /&gt;
_time&lt;BR /&gt;
event_simpleName&lt;BR /&gt;
FileName&lt;BR /&gt;
CommandLine&lt;BR /&gt;
UserName&lt;BR /&gt;
and a last column named "Attributes" that would contain only the existing field names and their value of the rest of the fields enumerated in the query:&lt;BR /&gt;
 DomainName SourceFileName TargetFileName RemoteAddressIP4 RemotePort_decimal LocalPort_decimal CommandLineParameters RegObjectName RegStringValue RegValueName ServiceDescription ServiceDisplayName ServiceImagePath ServiceStart_decimal ImageFileName InjectedDll SourceThreadModule TaskName TaskExecCommand TaskExecArguments&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428312#M122547</guid>
      <dc:creator>claudiuu</dc:creator>
      <dc:date>2020-09-29T21:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428313#M122548</link>
      <description>&lt;P&gt;@claudiuu, okie since we don't have any methods to identify between first few fields from others, give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search  |stats values(*) as * ,latest(_time) as _time by event_simpleName,FileName,CommandLine,UserName
|eval args=""
|foreach * [eval args=if("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"!="event_simpleName" AND "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"!="FileName" AND "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"!="CommandLine" AND "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"!="UserName",mvappend(args,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=".&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;),args)]
|table _time,event_simpleName,FileName,CommandLine,UserName,args
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428313#M122548</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-17T16:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428314#M122549</link>
      <description>&lt;P&gt;WOW, this is perfect.&lt;/P&gt;

&lt;P&gt;Thank you Nair!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428314#M122549</guid>
      <dc:creator>claudiuu</dc:creator>
      <dc:date>2018-10-19T13:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Output multiple multiple field names and values under a single column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428315#M122550</link>
      <description>&lt;P&gt;@claudiuu, glad that worked. Please accept as answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 14:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Output-multiple-multiple-field-names-and-values-under-a-single/m-p/428315#M122550</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-19T14:11:11Z</dc:date>
    </item>
  </channel>
</rss>

