<?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 exclude a hyphen &amp;quot;-&amp;quot; field value from my search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128966#M35048</link>
    <description>&lt;P&gt;When running this search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog | stats count by UserAgent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it gives me &lt;CODE&gt;-&lt;/CODE&gt; and a whole bunch of other User Agents. Some of the logs do not have User Agent, so they have &lt;CODE&gt;-&lt;/CODE&gt; instead. I just want to exclude this from the result. &lt;/P&gt;

&lt;P&gt;I tried: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog UserAgent!="-" | stats count by UserAgent
index=syslog UserAgent!=- | stats count by UserAgent
index=syslog NOT UserAgent=- | stats count by UserAgent
index=syslog NOT UserAgent="-" | stats count by UserAgent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No luck. Any help will be appreciated, thank you. &lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2015 02:46:46 GMT</pubDate>
    <dc:creator>dineshp</dc:creator>
    <dc:date>2015-04-07T02:46:46Z</dc:date>
    <item>
      <title>How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128966#M35048</link>
      <description>&lt;P&gt;When running this search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog | stats count by UserAgent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it gives me &lt;CODE&gt;-&lt;/CODE&gt; and a whole bunch of other User Agents. Some of the logs do not have User Agent, so they have &lt;CODE&gt;-&lt;/CODE&gt; instead. I just want to exclude this from the result. &lt;/P&gt;

&lt;P&gt;I tried: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog UserAgent!="-" | stats count by UserAgent
index=syslog UserAgent!=- | stats count by UserAgent
index=syslog NOT UserAgent=- | stats count by UserAgent
index=syslog NOT UserAgent="-" | stats count by UserAgent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;No luck. Any help will be appreciated, thank you. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 02:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128966#M35048</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2015-04-07T02:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128967#M35049</link>
      <description>&lt;P&gt;All of those are correct if the value of the UserAgent field is indeed sometimes a hyphen.&lt;BR /&gt;
So this suggests you've got to check yourself for assumptions.&lt;BR /&gt;
...|stats count by UserAgent|sort UserAgent&lt;BR /&gt;
does that show you the hyphen up at or near the top of the list?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 03:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128967#M35049</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-07T03:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128968#M35050</link>
      <description>&lt;P&gt;I know what you are saying, when i run .....|stats count by UserAgent|sort UserAgent&lt;BR /&gt;
"-" is always on the top with highest number of count. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 03:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128968#M35050</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2015-04-07T03:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128969#M35051</link>
      <description>&lt;P&gt;okidoke... now you have to start doubting your eyes... try &lt;CODE&gt;"*-*"&lt;/CODE&gt;   maybe there are control characters in there? maybe post a couple of events with your question. perhaps there's something off that another pair of eyeballs will see.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 03:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128969#M35051</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-07T03:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128970#M35052</link>
      <description>&lt;P&gt;In your results, if you hold the ALT key, and click on the "-" in the UserAgent column, does the drill-down search properly exclude it? If it does, copy the syntax that Splunk used to exclude it into your original search.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 15:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128970#M35052</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-07T15:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128971#M35053</link>
      <description>&lt;P&gt;Oh... Very good idea!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 15:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128971#M35053</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-07T15:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128972#M35054</link>
      <description>&lt;P&gt;If this worked, please choose "Accept Answer"&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 16:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128972#M35054</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-07T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128973#M35055</link>
      <description>&lt;P&gt;Naa.. That didnt work. when i press "Alt" and its came up as NOT - . &lt;BR /&gt;
This resulted lesser search result.  &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 21:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128973#M35055</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2015-04-07T21:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128974#M35056</link>
      <description>&lt;P&gt;This works, but i think its excluding something else as well.. Not just the UserAgent field. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 21:40:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128974#M35056</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2015-04-07T21:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128975#M35057</link>
      <description>&lt;P&gt;What version of Splunk are you using?  If it's current... clicking on the hyphen when you just list out the data should give you a popup with the option to list the events filtered by what you're clicking on. That should show you what Splunk is seeing...&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 22:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128975#M35057</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-07T22:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128976#M35058</link>
      <description>&lt;P&gt;show us a data sample please.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 22:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128976#M35058</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-07T22:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128977#M35059</link>
      <description>&lt;P&gt;I believe we are running 5.x There are no popups :'(&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 23:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128977#M35059</guid>
      <dc:creator>dineshp</dc:creator>
      <dc:date>2015-04-07T23:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128978#M35060</link>
      <description>&lt;P&gt;You've already said that when you did alt and clicked on it, splunk appended NOT - to your search, emulate that and put it in your original search &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;base search NOT - | ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Let us know the outcome&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 07:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128978#M35060</guid>
      <dc:creator>markthompson</dc:creator>
      <dc:date>2015-04-08T07:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128979#M35061</link>
      <description>&lt;P&gt;No dice...it filters out everything...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 19:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128979#M35061</guid>
      <dc:creator>autolycus</dc:creator>
      <dc:date>2015-06-16T19:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a hyphen "-" field value from my search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128980#M35062</link>
      <description>&lt;P&gt;What about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog | eval NullUserAgent=if(like(UserAgent, "-"), "True", "False")  | search NullUserAgent="False" | stats count by UserAgent 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=syslog | rex field=UserAgent "^(?P&amp;lt;NullUserAgent&amp;gt;\-)$" | search NOT NullUserAgent | stats count by UserAgent 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-a-hyphen-quot-quot-field-value-from-my-search/m-p/128980#M35062</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-06-16T21:29:36Z</dc:date>
    </item>
  </channel>
</rss>

