<?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: Generate list of all Fields in a Search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16991#M2317</link>
    <description>&lt;P&gt;I'm not sure about the "advanced charting" speed up thing.  Doesn't the very nature of a &lt;CODE&gt;stats "dc(*)"&lt;/CODE&gt; mean that all fields have to be extracted anyways.  It seems like will be an expensive operation no matter what.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2010 02:34:09 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-07-08T02:34:09Z</dc:date>
    <item>
      <title>Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16989#M2315</link>
      <description>&lt;P&gt;I would like to export a list of the fieldnames in any given search.  How could I do this?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 01:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16989#M2315</guid>
      <dc:creator>muebel</dc:creator>
      <dc:date>2010-07-08T01:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16990#M2316</link>
      <description>&lt;P&gt;This will give you a single row with one column for every field, where the cell values are the distinct counts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | stats dc(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then tacking the transpose command on the end will flip it around: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | stats dc(*) as * | transpose
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It'll be MUCH faster to run this search in the 'advanced charting' view instead of the default search UI, but once it's run you should be able to use the UI to export it as you would a regular search. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 01:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16990#M2316</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-07-08T01:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16991#M2317</link>
      <description>&lt;P&gt;I'm not sure about the "advanced charting" speed up thing.  Doesn't the very nature of a &lt;CODE&gt;stats "dc(*)"&lt;/CODE&gt; mean that all fields have to be extracted anyways.  It seems like will be an expensive operation no matter what.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 02:34:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16991#M2317</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-08T02:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16992#M2318</link>
      <description>&lt;P&gt;Just a quick addition to what Nick said.&lt;/P&gt;

&lt;P&gt;If you want to also see hidden fields, you can do so with a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename _* AS aHiddenField__* | stats dc(*) as * | transpose | replace "aHiddenField__*" with "_*" in column
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; As pointed out in a commend below, that this can be further simplified like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats dc(_*) as aHiddenField__* dc(*) as * | transpose | replace "aHiddenField__*" with "_*" in column
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both of these approaches simply rename hidden fields temporarily (they are given a hopefully unique prefix).  Afterwards we use a &lt;CODE&gt;replace&lt;/CODE&gt; to return the fields to their original names.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 02:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16992#M2318</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-08T02:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16993#M2319</link>
      <description>&lt;P&gt;Advanced charting will be faster primarily because it doesn't need to keep track of a &lt;CODE&gt;top&lt;/CODE&gt; for every single field in addition to the main search.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 03:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16993#M2319</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-08T03:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16994#M2320</link>
      <description>&lt;P&gt;If you want hidden fields, you can also do &lt;CODE&gt;... | stats dc(_*) as xxx_* , dc(*) as *&lt;/CODE&gt; instead, or just &lt;CODE&gt;... | stats dc(_*),dc(*)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 03:23:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16994#M2320</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-08T03:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16995#M2321</link>
      <description>&lt;P&gt;Indeed.   flashtimeline will dispatch even the simplest reporting command in a way that incurs huge expense. Check out the 'Affecting Search Performance' section of the ui_examples app. The examples and the copy in there will give you a quick tour of the issues.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 05:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16995#M2321</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-07-08T05:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16996#M2322</link>
      <description>&lt;P&gt;Nick, I can't find that section in the &lt;CODE&gt;ui_example&lt;/CODE&gt; apps.  I downloaded the latest copy of the app (1.1 from Jan 19, 2010) -- from this URL &lt;A href="http://www.splunkbase.com/apps/All/4.x/Add-On/app:UI+Examples"&gt;http://www.splunkbase.com/apps/All/4.x/Add-On/app:UI+Examples&lt;/A&gt;  But I am unable to find the view which contains this information.  Is there a newer version somewhere else?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 20:17:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16996#M2322</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-08T20:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16997#M2323</link>
      <description>&lt;P&gt;I found it.   I was looking at the 4.0 examples and had not noticed that a new one for 4.1 was released.   Here is the URL for anyone following along:  &lt;A href="http://www.splunkbase.com/apps/All/4.x/Add-On/app:UI+Examples+for+4.1"&gt;http://www.splunkbase.com/apps/All/4.x/Add-On/app:UI+Examples+for+4.1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2010 20:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16997#M2323</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-08T20:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16998#M2324</link>
      <description>&lt;P&gt;Is there a way to output only the fields identified in transforms.conf? &lt;/P&gt;

&lt;P&gt;If not, can you ordered the fields by the percentage of events that contain those fields?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 16:35:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16998#M2324</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-02-15T16:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16999#M2325</link>
      <description>&lt;P&gt;This works in Splunk 6.2.1 only if you add an asterisk after the &lt;EM&gt;as&lt;/EM&gt;, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | stats dc() as * | transpose
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jan 2015 01:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/16999#M2325</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-01-28T01:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17000#M2326</link>
      <description>&lt;P&gt;this worked for me &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | stats dc(c*)&lt;/CODE&gt; look for fields beginning with &lt;CODE&gt;c&lt;/CODE&gt;,&lt;BR /&gt;
&lt;CODE&gt;... | stats dc(c*) | transpose&lt;/CODE&gt; look for fields beginning with &lt;CODE&gt;c&lt;/CODE&gt;, transpose just flips it &lt;/P&gt;

&lt;P&gt;Now what i want to know is how to insert row number when i flip it using &lt;CODE&gt;transpose&lt;/CODE&gt;? &lt;BR /&gt;
found it &lt;A href="http://answers.splunk.com/answers/216542/how-to-add-a-first-column-to-number-each-row-in-a.html"&gt;here&lt;/A&gt;&lt;BR /&gt;
&lt;CODE&gt;... | stats dc(c*) | transpose  | streamstats count as row | fields row *&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2015 22:09:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17000#M2326</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-03-18T22:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17001#M2327</link>
      <description>&lt;P&gt;Since the original answer in 2010, we now have the &lt;CODE&gt;fieldsummary&lt;/CODE&gt; command, so you can list the fields from a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | fieldsummary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This command provides a lot more info than just the field names, though. So you might want to do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | fieldsummary | fields field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jun 2016 16:19:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17001#M2327</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-06-10T16:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Generate list of all Fields in a Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17002#M2328</link>
      <description>&lt;P&gt;how to do this without getting _time and _raw?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 20:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-list-of-all-Fields-in-a-Search/m-p/17002#M2328</guid>
      <dc:creator>jzapantis</dc:creator>
      <dc:date>2017-05-02T20:34:04Z</dc:date>
    </item>
  </channel>
</rss>

