<?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: escaping hyphen if any field has hyphen(-) as value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111636#M183665</link>
    <description>&lt;P&gt;have you tried :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| search "Account Name"="*-*"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jun 2014 15:53:20 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2014-06-19T15:53:20Z</dc:date>
    <item>
      <title>escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111635#M183664</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I have data like below in the Active Directory.&lt;/P&gt;

&lt;H2&gt;Account Name&lt;/H2&gt;

&lt;P&gt;-&lt;BR /&gt;
L-15485&lt;BR /&gt;
D-5486&lt;BR /&gt;
BLR-DC-09$&lt;/P&gt;

&lt;P&gt;Here is my query;&lt;BR /&gt;
| search "Account Name"="-"&lt;/P&gt;

&lt;H2&gt;showing Output:&lt;/H2&gt;

&lt;P&gt;BLR-DC-09$&lt;/P&gt;

&lt;H2&gt;but actual output to be expected:&lt;/H2&gt;

&lt;P&gt;L-15485&lt;BR /&gt;
D-5486&lt;BR /&gt;
BLR-DC-09$&lt;/P&gt;

&lt;P&gt;Note: I read splunk document for -(hyphen) it says - for match any character.&lt;BR /&gt;
Now my question is how to escape that one as it works.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 15:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111635#M183664</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2014-06-19T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111636#M183665</link>
      <description>&lt;P&gt;have you tried :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| search "Account Name"="*-*"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 15:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111636#M183665</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-06-19T15:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111637#M183666</link>
      <description>&lt;P&gt;Try | search "Account Name"="*"&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 15:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111637#M183666</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-19T15:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111638#M183667</link>
      <description>&lt;P&gt;for hyphen?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 15:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111638#M183667</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2014-06-19T15:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111639#M183668</link>
      <description>&lt;P&gt;I tried that one by that also im getting only BLR-DC-09$&lt;BR /&gt;
I want to remove only - values from that field.&lt;BR /&gt;
your query is wrong..&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 16:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111639#M183668</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2014-06-19T16:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111640#M183669</link>
      <description>&lt;P&gt;I'm not sure where you read that hyphen matches any character in Splunk. Could you please provide a link to where it says that? I can't think of a circumstance where it does, especially inside quotes.&lt;/P&gt;

&lt;P&gt;I don't think I understand what you mean by "escape." Are you trying to write a search that returns all rows except the ones where the Account Name field has just a hyphen in it? And if so, does:&lt;/P&gt;

&lt;P&gt;"Account Name"!="-"&lt;/P&gt;

&lt;P&gt;not work? If not, how about:&lt;/P&gt;

&lt;P&gt;"Account Name"!="\-"&lt;/P&gt;

&lt;P&gt;What does that get you?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 17:07:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111640#M183669</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-06-19T17:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111641#M183670</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
you need the where clause.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|where "Account Name" like "%-%-%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
L&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2014 17:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111641#M183670</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-06-19T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: escaping hyphen if any field has hyphen(-) as value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111642#M183671</link>
      <description>&lt;P&gt;My use case was a little different, I was trying to remove Account_Name = "-" from sourcetype = ActiveDirectory, and the where clause was the only method that I could find that produced the results I needed.  Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 16:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/escaping-hyphen-if-any-field-has-hyphen-as-value/m-p/111642#M183671</guid>
      <dc:creator>ewelch_splunk</dc:creator>
      <dc:date>2018-12-11T16:19:56Z</dc:date>
    </item>
  </channel>
</rss>

