<?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 Using wildcard in fields command not working as expected in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191663#M55184</link>
    <description>&lt;P&gt;For example the following search continues to include fields that start with user (such as userName, userId) etc.&lt;/P&gt;

&lt;P&gt;index=blah | fields - user* &lt;/P&gt;

&lt;P&gt;Has anyone else seen this or am I just doing this wrong?&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2015 13:59:41 GMT</pubDate>
    <dc:creator>treywebb</dc:creator>
    <dc:date>2015-05-20T13:59:41Z</dc:date>
    <item>
      <title>Using wildcard in fields command not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191663#M55184</link>
      <description>&lt;P&gt;For example the following search continues to include fields that start with user (such as userName, userId) etc.&lt;/P&gt;

&lt;P&gt;index=blah | fields - user* &lt;/P&gt;

&lt;P&gt;Has anyone else seen this or am I just doing this wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 13:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191663#M55184</guid>
      <dc:creator>treywebb</dc:creator>
      <dc:date>2015-05-20T13:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard in fields command not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191664#M55185</link>
      <description>&lt;P&gt;I am skeptical of your claim.  Just because the fields do not exist, does not mean that the data to which they used to point will be obliterated from your event (which is perhaps the mistaken assumption you are using to presume that the command isn't working).  I will prove that the command works; try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah | stats count by userName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will surely give you data.  Now try it after removing the fields like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah | fields - user* | stats count by userName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will surely yield no results.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 14:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191664#M55185</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-20T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard in fields command not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191665#M55186</link>
      <description>&lt;P&gt;You will still see those fields in the raw data, Splunk doesn't change that. What does change are the fields it is keeping track of going forward.&lt;/P&gt;

&lt;P&gt;For instance, your results for these two searches should be different:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah | fields - user* | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Eliminating fields you don't need as you build your search string just means that Splunk internally doesn't keep them around anymore as it is generating your search results. Splunk never changes your raw data, only how it is interpreted.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 14:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191665#M55186</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-05-20T14:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using wildcard in fields command not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191666#M55187</link>
      <description>&lt;P&gt;This explains it perfectly. I was overlooking _raw in the events tab. doing as you show here works as expected. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 15:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-wildcard-in-fields-command-not-working-as-expected/m-p/191666#M55187</guid>
      <dc:creator>treywebb</dc:creator>
      <dc:date>2015-05-20T15:19:27Z</dc:date>
    </item>
  </channel>
</rss>

