<?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: Splunk search fails with content that contains a hyphen (-)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376966#M168111</link>
    <description>&lt;P&gt;Thanks a lot. The config change in 'fields.conf' file saved my day.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 06:19:47 GMT</pubDate>
    <dc:creator>jawaharas</dc:creator>
    <dc:date>2019-07-09T06:19:47Z</dc:date>
    <item>
      <title>Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376961#M168106</link>
      <description>&lt;P&gt;We're running into something weird where searches may fail. We think it is due to dashes&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="kubernetes" pod="podname-3220973768-tr295"&lt;/CODE&gt; - This fails&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="kubernetes" pod="podname*"&lt;/CODE&gt; - this works fine&lt;/P&gt;

&lt;P&gt;Another example&lt;BR /&gt;
   &lt;CODE&gt;index="kubernetes" fix-something-here&lt;/CODE&gt; - this finds a bunch of entries&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="kubernetes" fix-something-here namespace="kube-system"&lt;/CODE&gt; - This fails&lt;/P&gt;

&lt;P&gt;The actual message for the last example is  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Found 10 events related to fix-something-here-r2hnp pod in prod namespace
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We suspect it is due to the dashes but we're not a hundred percent sure. Does anyone have some tips?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376961#M168106</guid>
      <dc:creator>itbetter</dc:creator>
      <dc:date>2018-07-26T20:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376962#M168107</link>
      <description>&lt;P&gt;Hi @itbetter&lt;/P&gt;

&lt;P&gt;Can be a possibility that the field values are having invisible spaces,&lt;/P&gt;

&lt;P&gt;remove those spaces in the field values by &lt;/P&gt;

&lt;P&gt;index="kubernetes" | eval pod=trim(pod) | search  pod="podname-3220973768-tr295"&lt;/P&gt;

&lt;P&gt;give a try with above search, hope it helps&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 21:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376962#M168107</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-07-26T21:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376963#M168108</link>
      <description>&lt;P&gt;No joy. Still didn't work. We've learned that splunk uses the dash or hyphen as a wildcard. Is there a way to escape it?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 14:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376963#M168108</guid>
      <dc:creator>itbetter</dc:creator>
      <dc:date>2018-07-27T14:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376964#M168109</link>
      <description>&lt;P&gt;1) I am able to search for hosts with hyphens in their names&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host="abc-def"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) I have data where my field values have hyphens in them, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 2018-07-28 21:00:00  db_dt="2018-07-28 09:20:00"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to search for&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main db_dt="2018-07-28 09:20:00"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3)  I have seen a different issues with hyphens in fieldnames&lt;/P&gt;

&lt;P&gt;If I have keyword=value and my keyword has a hyphen or a period in the name, Splunk converts these to underscores. &lt;/P&gt;

&lt;P&gt;For example events like &lt;CODE&gt;text.abc-foo.disabled="0"&lt;/CODE&gt;  will get me a field named &lt;CODE&gt;text_abc_foo_disabled&lt;/CODE&gt; with value 0&lt;/P&gt;

&lt;P&gt;4) Only thing I can think of are your hyphens doubled? e.g. podname followed by two hyphens and you are searching for one?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jul 2018 21:35:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376964#M168109</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2018-07-28T21:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376965#M168110</link>
      <description>&lt;P&gt;Hi itbetter!&lt;/P&gt;

&lt;P&gt;This experience can be remedied by deploying a &lt;CODE&gt;fields.conf&lt;/CODE&gt; to the search heads for the index time fields Splunk Connect for Kubernetes sends. You can confirm this by searching with the syntax &lt;CODE&gt;field::foo&lt;/CODE&gt; and you should see the results you expect. &lt;/P&gt;

&lt;P&gt;Default Indexed fields Splunk Connect for Kubernetes sends:&lt;BR /&gt;
&lt;A href="https://github.com/splunk/splunk-connect-for-kubernetes/blob/522a5e57c69d06caef24268737fb65863fdbbade/manifests/splunk-kubernetes-logging/configMap.yaml#L217"&gt;https://github.com/splunk/splunk-connect-for-kubernetes/blob/522a5e57c69d06caef24268737fb65863fdbbade/manifests/splunk-kubernetes-logging/configMap.yaml#L217&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;More on the fluent-hec plugin fields option here:&lt;BR /&gt;
&lt;A href="https://github.com/splunk/fluent-plugin-splunk-hec#fields-section-optional-single"&gt;https://github.com/splunk/fluent-plugin-splunk-hec#fields-section-optional-single&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;More on Index time field configs:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Data/Configureindex-timefieldextraction#Where_to_put_the_configuration_changes_in_a_distributed_environment"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Data/Configureindex-timefieldextraction#Where_to_put_the_configuration_changes_in_a_distributed_environment&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;What should go in &lt;CODE&gt;fields.conf&lt;/CODE&gt; :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[namespace]
INDEXED = true

[pod]
INDEXED = true

[container_name]
INDEXED = true

[container_id]
INDEXED = true

[cluster_name]
INDEXED = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/admin/Fieldsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/admin/Fieldsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Just be aware of any conflicts with any other apps that extract these same field names at search time, as this config would interfere with that. &lt;/P&gt;

&lt;P&gt;This has to do with the concept of "Major Breakers" which our good friend @martin_mueller can explain much better than I ever could:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://conf.splunk.com/files/2017/recordings/fields-indexed-tokens-and-you.mp4"&gt;https://conf.splunk.com/files/2017/recordings/fields-indexed-tokens-and-you.mp4&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://conf.splunk.com/files/2017/slides/fields-indexed-tokens-and-you.pdf"&gt;https://conf.splunk.com/files/2017/slides/fields-indexed-tokens-and-you.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 18:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376965#M168110</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2019-04-02T18:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376966#M168111</link>
      <description>&lt;P&gt;Thanks a lot. The config change in 'fields.conf' file saved my day.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 06:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376966#M168111</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-07-09T06:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search fails with content that contains a hyphen (-)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376967#M168112</link>
      <description>&lt;P&gt;@itbetter be sure to accept the answer if it got ya rocking!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 19:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-fails-with-content-that-contains-a-hyphen/m-p/376967#M168112</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2019-07-15T19:15:35Z</dc:date>
    </item>
  </channel>
</rss>

