<?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 dynamically extract fields from Events(without internal fields like source,sourcetype,host etc..) and pipe it as fieldlist to table command. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160307#M45306</link>
    <description>&lt;P&gt;I need to create table with fields present in Events result,excluding internal fields.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Indexed Data:
A=xxx B=yyy C=zzz
A=fhf B=vvv C=bbb
A=xer B=yqw C=zui D=yuu E=hgjhg
A=clk B=viu C=bfg F=hh G=hjkh
A=asd B=viu C=mnnmn F=hj G=yuyu
A=rtr B=viu C=bfg F=hh G=hjkh H=ghg&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt; Scenario 1:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A=xxx B=yyy C=zzz&lt;BR /&gt;
A=fhf  B=vvv C=bbb&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A   B    C&lt;BR /&gt;
xxx yyy zzz&lt;BR /&gt;
fhf vvv bbb&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt;Scenario 2:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A=xer B=yqw C=zui D=yuu E=hgjhg&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A     B     C    D   E&lt;BR /&gt;
xer yqw zui yuu hgjhg&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt;Scenario 3:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;BR /&gt;
A=clk B=viu C=bfg F=hh G=hjkh&lt;BR /&gt;
A=asd B=viu C=mnnmn F=hj G=yuyu&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A      B      C     F   G&lt;BR /&gt;
clk viu bfg   hh    hjkh&lt;BR /&gt;
asd viu mnnmn   hj  yuyu&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I tried the below command to exclude internal fields and display the event fields alone in table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table * | fields - *Time source* host _raw date_* index linecount punct eventtype time*pos splunk_server _time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the result i am getting(scenario 3) is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A     B   C      D           E         F    G        H
clk viu bfg   (empty)       (empty) hh  hjkh    (empty)
asd viu mnnmn   (empty)     (empty) hj  yuyu    (empty)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The same case applies for other above mentioned scenarios too.&lt;BR /&gt;
Is it possible to remove empty fields,showing only the fields with values.Also the empty fields shouldn't be filled with null or any other static values.&lt;BR /&gt;
or Is there any possibility to extract the fields(excluding internal fields) alone from events,so that it can be piped to table command as fieldlist.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Restrictions:&lt;/STRONG&gt;&lt;BR /&gt;
The fields in event are not static.It changes dynamically depending on the logs getting forwarded.&lt;BR /&gt;
Fieldlist to table command shouldn't be specified in static way(like table A,B,C or table Q,A,Z,X).&lt;BR /&gt;
It has to be generated through some other commands.&lt;/P&gt;

&lt;P&gt;Thanks in advance...&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2014 08:18:02 GMT</pubDate>
    <dc:creator>jackson1990</dc:creator>
    <dc:date>2014-12-17T08:18:02Z</dc:date>
    <item>
      <title>How to dynamically extract fields from Events(without internal fields like source,sourcetype,host etc..) and pipe it as fieldlist to table command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160307#M45306</link>
      <description>&lt;P&gt;I need to create table with fields present in Events result,excluding internal fields.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Indexed Data:
A=xxx B=yyy C=zzz
A=fhf B=vvv C=bbb
A=xer B=yqw C=zui D=yuu E=hgjhg
A=clk B=viu C=bfg F=hh G=hjkh
A=asd B=viu C=mnnmn F=hj G=yuyu
A=rtr B=viu C=bfg F=hh G=hjkh H=ghg&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt; Scenario 1:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A=xxx B=yyy C=zzz&lt;BR /&gt;
A=fhf  B=vvv C=bbb&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A   B    C&lt;BR /&gt;
xxx yyy zzz&lt;BR /&gt;
fhf vvv bbb&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt;Scenario 2:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A=xer B=yqw C=zui D=yuu E=hgjhg&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A     B     C    D   E&lt;BR /&gt;
xer yqw zui yuu hgjhg&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;H2&gt;Scenario 3:&lt;/H2&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;SearchResult:&lt;/STRONG&gt;&lt;BR /&gt;
A=clk B=viu C=bfg F=hh G=hjkh&lt;BR /&gt;
A=asd B=viu C=mnnmn F=hj G=yuyu&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Expected Table:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A      B      C     F   G&lt;BR /&gt;
clk viu bfg   hh    hjkh&lt;BR /&gt;
asd viu mnnmn   hj  yuyu&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I tried the below command to exclude internal fields and display the event fields alone in table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table * | fields - *Time source* host _raw date_* index linecount punct eventtype time*pos splunk_server _time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the result i am getting(scenario 3) is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A     B   C      D           E         F    G        H
clk viu bfg   (empty)       (empty) hh  hjkh    (empty)
asd viu mnnmn   (empty)     (empty) hj  yuyu    (empty)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The same case applies for other above mentioned scenarios too.&lt;BR /&gt;
Is it possible to remove empty fields,showing only the fields with values.Also the empty fields shouldn't be filled with null or any other static values.&lt;BR /&gt;
or Is there any possibility to extract the fields(excluding internal fields) alone from events,so that it can be piped to table command as fieldlist.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Restrictions:&lt;/STRONG&gt;&lt;BR /&gt;
The fields in event are not static.It changes dynamically depending on the logs getting forwarded.&lt;BR /&gt;
Fieldlist to table command shouldn't be specified in static way(like table A,B,C or table Q,A,Z,X).&lt;BR /&gt;
It has to be generated through some other commands.&lt;/P&gt;

&lt;P&gt;Thanks in advance...&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 08:18:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160307#M45306</guid>
      <dc:creator>jackson1990</dc:creator>
      <dc:date>2014-12-17T08:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically extract fields from Events(without internal fields like source,sourcetype,host etc..) and pipe it as fieldlist to table command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160308#M45307</link>
      <description>&lt;P&gt;Hi Jackson,&lt;BR /&gt;
To fill an empty field with null or other value you can use the commande &lt;STRONG&gt;fillnull&lt;/STRONG&gt;  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;... | fillnull value=NULL&lt;/STRONG&gt; &lt;BR /&gt;
you can also specified the fields to work on if you like &lt;BR /&gt;
&lt;STRONG&gt;... | fillnull value=NULL fieldx fieldy .....&lt;/STRONG&gt;&lt;BR /&gt;
you can replace &lt;STRONG&gt;NULL&lt;/STRONG&gt; by a &lt;STRONG&gt;string&lt;/STRONG&gt; of your choise&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 09:31:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160308#M45307</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2014-12-17T09:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically extract fields from Events(without internal fields like source,sourcetype,host etc..) and pipe it as fieldlist to table command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160309#M45308</link>
      <description>&lt;P&gt;You have to filter down to only the specific event types you want &lt;EM&gt;before&lt;/EM&gt; your do any automatic field extractions or "table *" commands.  &lt;/P&gt;

&lt;P&gt;I've hit this problem myself, and you have to prefilter.&lt;/P&gt;

&lt;P&gt;If you have to filter on extracted fields (or if you have a kv_mode=json in your props.conf), you could remove all but the _raw field and then re-extract all the fields; when you do "table *" after that you should see only fields that actually show up in the results. &lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 18:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dynamically-extract-fields-from-Events-without-internal/m-p/160309#M45308</guid>
      <dc:creator>capnjosh</dc:creator>
      <dc:date>2015-02-05T18:00:50Z</dc:date>
    </item>
  </channel>
</rss>

