<?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 seach using a concatenated string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34165#M7342</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a lot of sources like this:&lt;/P&gt;

&lt;P&gt;source="/u01/app/oracle/admin/AUD/audit/report/host-audit-report-2011-Dec-12.csv"&lt;/P&gt;

&lt;P&gt;and I want to make a search with a substring with part of the file name because the path and the host could change:&lt;/P&gt;

&lt;P&gt;namefile="*-2011-Dec-12.csv"&lt;/P&gt;

&lt;P&gt;But the search is:&lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | eval namefile="*-2011-Dec-12.csv" | where source=namefile&lt;/P&gt;

&lt;P&gt;doesn't word due to the wildchar (*) because the search:&lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | eval namefile="/u01/app/oracle/admin/AUD/audit/report/host-audit-report-2011-Dec-12.csv" | where source=namefile&lt;/P&gt;

&lt;P&gt;works perfectly. &lt;BR /&gt;
Obviously I semplified the subsearch. In the eval function I will use the strftime function to extract year, month and day of today or yesterday and so on.&lt;BR /&gt;
Any suggestions to use wildchar?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2011 17:28:00 GMT</pubDate>
    <dc:creator>Cris</dc:creator>
    <dc:date>2011-12-13T17:28:00Z</dc:date>
    <item>
      <title>How to seach using a concatenated string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34165#M7342</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a lot of sources like this:&lt;/P&gt;

&lt;P&gt;source="/u01/app/oracle/admin/AUD/audit/report/host-audit-report-2011-Dec-12.csv"&lt;/P&gt;

&lt;P&gt;and I want to make a search with a substring with part of the file name because the path and the host could change:&lt;/P&gt;

&lt;P&gt;namefile="*-2011-Dec-12.csv"&lt;/P&gt;

&lt;P&gt;But the search is:&lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | eval namefile="*-2011-Dec-12.csv" | where source=namefile&lt;/P&gt;

&lt;P&gt;doesn't word due to the wildchar (*) because the search:&lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | eval namefile="/u01/app/oracle/admin/AUD/audit/report/host-audit-report-2011-Dec-12.csv" | where source=namefile&lt;/P&gt;

&lt;P&gt;works perfectly. &lt;BR /&gt;
Obviously I semplified the subsearch. In the eval function I will use the strftime function to extract year, month and day of today or yesterday and so on.&lt;BR /&gt;
Any suggestions to use wildchar?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2011 17:28:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34165#M7342</guid>
      <dc:creator>Cris</dc:creator>
      <dc:date>2011-12-13T17:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to seach using a concatenated string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34166#M7343</link>
      <description>&lt;P&gt;Not sure if you have already tried this, but a simpler solution should be to search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="*-2011-Dec-12.csv"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or if the date changes...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="*-audit-report-*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this answers your question.&lt;/P&gt;

&lt;P&gt;If it does answer your question, please mark the answer as accepted (the tick next to the answer) for the benefit of the community.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2011 17:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34166#M7343</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2011-12-13T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to seach using a concatenated string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34167#M7344</link>
      <description>&lt;P&gt;Another option would be to just define a sourcetype for each source to keep things simpler. In your eval you have an issue with the wildcard as you have it surrounded with " "'s which turn it into a string literal, removing these will not make any difference as you can't store a wildcard in a variable defined by eval like that (that I am aware of)&lt;/P&gt;

&lt;P&gt;Otherwise MHibbins suggestion to just search for source=*-2011-Dec-12.csv would work much better.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2011 21:31:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-seach-using-a-concatenated-string/m-p/34167#M7344</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-12-13T21:31:38Z</dc:date>
    </item>
  </channel>
</rss>

