<?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: list all fields within a sourcetype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83843#M21367</link>
    <description>&lt;P&gt;It depends on the version of Splunk that you're running. If you're on 5.0 or above, you can use the new &lt;CODE&gt;fieldsummary&lt;/CODE&gt; command. &lt;/P&gt;

&lt;P&gt;Ex. &lt;CODE&gt;index=my_index sourcetype=my_sourcetype | fieldsummary&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;fieldsummary&lt;/CODE&gt; does not work on metadata so it needs to scan all events for all possible fields. This means that it can be pretty expensive if not scoped properly in time. &lt;BR /&gt;
Additional info here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldsummary"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldsummary&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2013 04:40:04 GMT</pubDate>
    <dc:creator>_d_</dc:creator>
    <dc:date>2013-04-04T04:40:04Z</dc:date>
    <item>
      <title>list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83841#M21365</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Is there a way to display all fields being used by a sourcetype, without the values? &lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 16:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83841#M21365</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2013-04-03T16:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83842#M21366</link>
      <description>&lt;P&gt;No. The fields that exist are determined dynamically depending on the data, and so can not be determined without looking at sufficient data from that sourcetype. There is no way without looking at every piece of data to know with 100% certainty that you have seen all possible fields.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 21:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83842#M21366</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-04-03T21:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83843#M21367</link>
      <description>&lt;P&gt;It depends on the version of Splunk that you're running. If you're on 5.0 or above, you can use the new &lt;CODE&gt;fieldsummary&lt;/CODE&gt; command. &lt;/P&gt;

&lt;P&gt;Ex. &lt;CODE&gt;index=my_index sourcetype=my_sourcetype | fieldsummary&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;fieldsummary&lt;/CODE&gt; does not work on metadata so it needs to scan all events for all possible fields. This means that it can be pretty expensive if not scoped properly in time. &lt;BR /&gt;
Additional info here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldsummary"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldsummary&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 04:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83843#M21367</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2013-04-04T04:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83844#M21368</link>
      <description>&lt;P&gt;If you have 6x you could run the following search. Adjust the initial search to limit scope and then adjust the dedup piece to attempt to capture enough of your sourcetype to get the majority of the fields. There is a balance to be struck /shrug&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search to limit scope&amp;gt; | dedup 20 sourcetype punct | table * | fields - _raw date_* index linecount punct eventtype time*pos splunk_server  | foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'."##".sourcetype."##||" ] | stats max(*) as * |  transpose | rename "row 1" as sourcetype column as field | rex field=sourcetype "##(?&amp;lt;sourcetype&amp;gt;[^#]+)" | eval fieldsort = lower(field) | dedup sourcetype field | sort sourcetype fieldsort | table sourcetype field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Apr 2014 17:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83844#M21368</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-04-23T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83845#M21369</link>
      <description>&lt;P&gt;This works well.  You can remove some extraneous information if you want just the fields, count and value&lt;/P&gt;

&lt;P&gt;index=my_index sourcetype=my_sourcetype   | fieldsummary | fields - max mean min stdev numeric_count is_exact&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83845#M21369</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2020-09-29T23:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: list all fields within a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83846#M21370</link>
      <description>&lt;P&gt;I like it!  if we are only interested in fields likely on every record of a sourcetype, we could speed it up by only taking the first record found:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index sourcetype=my_sourcetype | head 1| fieldsummary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;furthermore, if we are only interested in a summary the field values (say to search on where certain named fields appear), we can aggregate those&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs sourcetype=pan:traffic 
| head 1
| fieldsummary 
| table field
| mvcombine delim=", " field 
| nomv field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 May 2019 20:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/list-all-fields-within-a-sourcetype/m-p/83846#M21370</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2019-05-23T20:43:38Z</dc:date>
    </item>
  </channel>
</rss>

