<?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: Include source file that ended with date (not bz2) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578010#M201431</link>
    <description>&lt;P&gt;Unfortunately, the filter part of the search does not in itself provide support for regexes, so you can only match on simple wildcards.&lt;/P&gt;&lt;P&gt;But, since you're only interested in the source field values, it's way, way more effective to use tstats instead of simple search and statsing.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;PRE&gt;| tstats values(source) as source where index=myindex"&lt;BR /&gt;| mvexpand source&lt;BR /&gt;| regex source="/data/app/.*\d{4}-\d{2}-\d{2}$"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;In general case - &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; 's soultion is quite ok. It's just that in this particular case |tstats is way faster.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 13:19:14 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2021-12-10T13:19:14Z</dc:date>
    <item>
      <title>Include source file that ended with date (not bz2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/577993#M201419</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Need to declare in spl Include only those file that has ended with date not .bz2 (I don’t want to use&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;NOT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Here is spl:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;index="myindex" source="/data/app/20211209/CUS/app.log.*" | dedup source| table source&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Return:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;/data/app/20211209/CUS/app.log.2021-12-09.bz2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;/data/app/20211209/CUS/app.log.2021-12-09&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I try below spl but doesn’t return result &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;source="/data/app/20211209/CUS/app.log.*.”&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 10:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/577993#M201419</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-12-10T10:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Include source file that ended with date (not bz2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578006#M201428</link>
      <description>&lt;P&gt;A regular expression should do the job.&amp;nbsp; Use a wildcard in the base search to select events, then narrow the selection using regex.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" source="/data/app/20211209/CUS/app.log.*" 
| regex source="app\.log\.\d{4}-\d\d-\d\d$"
| dedup source
| table source&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Dec 2021 13:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578006#M201428</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-10T13:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Include source file that ended with date (not bz2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578010#M201431</link>
      <description>&lt;P&gt;Unfortunately, the filter part of the search does not in itself provide support for regexes, so you can only match on simple wildcards.&lt;/P&gt;&lt;P&gt;But, since you're only interested in the source field values, it's way, way more effective to use tstats instead of simple search and statsing.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;PRE&gt;| tstats values(source) as source where index=myindex"&lt;BR /&gt;| mvexpand source&lt;BR /&gt;| regex source="/data/app/.*\d{4}-\d{2}-\d{2}$"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;In general case - &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt; 's soultion is quite ok. It's just that in this particular case |tstats is way faster.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 13:19:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578010#M201431</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-10T13:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Include source file that ended with date (not bz2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578026#M201440</link>
      <description>&lt;P&gt;There is no problem using NOT source=*bz2 ... or source !=*.bz2 assuming you mention source=...&lt;/P&gt;&lt;P&gt;Adding an extra filter after a pipe with any where/search/regex option would not give you the best performance.&lt;/P&gt;&lt;P&gt;If this is a real problem, then consider indexing the bz2 files in another index.&lt;/P&gt;&lt;P&gt;You should also find your data by narrowing down to the sourcetype, no ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 14:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Include-source-file-that-ended-with-date-not-bz2/m-p/578026#M201440</guid>
      <dc:creator>ldongradi_SPL</dc:creator>
      <dc:date>2021-12-10T14:56:33Z</dc:date>
    </item>
  </channel>
</rss>

