<?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: How to create a list of source files for use in primary search? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340321#M62772</link>
    <description>&lt;P&gt;The extra bracket ']' after [|inputlookup icimlogs.csv] was a typo. I have removed it, and the error is now gone. However, I am still only outputting my original file list, and not the filtered list.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2018 21:41:51 GMT</pubDate>
    <dc:creator>aoleske</dc:creator>
    <dc:date>2018-01-30T21:41:51Z</dc:date>
    <item>
      <title>How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340320#M62771</link>
      <description>&lt;P&gt;My question focuses around using one search to create a list of files I don’t want to consider in the primary search. Here is an overview of the problem I am trying to solve. I have a directory that fills with small files, one file per transaction series for an application we run. &lt;BR /&gt;
1)  Each file is a source. &lt;BR /&gt;
2)  If the file contains “Transaction Rolled Back" OR "Process FNXML Complete”, I do not want to have the filename (source) in the final list of sources. I am looking for transactions that did not complete.&lt;BR /&gt;
3)  I would like the final output to be a list of sources (log files) that do not have the “Transaction Rolled Back" OR "Process FNXML Complete” messages within the last three file lines. &lt;/P&gt;

&lt;P&gt;Data examples are:&lt;BR /&gt;
Action 1/9/2018 3:08:33 PM: XML Processing is complete.&lt;BR /&gt;
Action 1/9/2018 3:08:33 PM: *******&lt;STRONG&gt;&lt;EM&gt;Commit Transaction *&lt;/EM&gt;&lt;/STRONG&gt;******&lt;BR /&gt;
Action 1/9/2018 3:08:33 PM: Not writing to if_header - No transaction was set in the XML.&lt;BR /&gt;
Action 1/9/2018 3:08:33 PM: ProcessNode Complete&lt;BR /&gt;
Action 1/9/2018 3:08:33 PM: Process FNXML Complete.&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;Action 1/9/2018 3:05:37 PM: ******** Transaction Rolled Back **********&lt;BR /&gt;
Action 1/9/2018 3:05:37 PM: ErrorDesc=The current status of the shop order [RUN] is not in the list of old shop order oper status values.&lt;BR /&gt;&lt;BR /&gt;
Action 1/9/2018 3:05:37 PM: Not writing to if_header - No transaction was set in the XML.&lt;/P&gt;

&lt;P&gt;When I run the following command, I will get a list of sources that looks like something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=vel*) index=velocity sourcetype="velocity:icim" source="E:\\logs\\icim\\*"  
| stats count by source
OUTPUT:
source                                                                                         count (This is linecount)
E:\logs\Intercim\10076010920181646645312.log    17
E:\logs\Intercim\10076010920181646746093.log    34
E:\logs\Intercim\10076010920181646750905.log    20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can create the lookup table successfully, and create a separate search to compare the search against the lookup table, but I can’t seem to create a combined search. Part of the issue is that the second half, as I get a “Mismatched ‘]’ error. I think the issue is a subsearch within a subsearch, but am not sure how to get past it. Any help would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Works to create lookup table: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=vel*) index=velocity sourcetype="velocity:icim" source="E:\\logs\\icim\\*" ("Transaction Rolled Back" OR "Process FNXML Complete") 
| dedup source 
| stats count by source 
| fields source 
| outputlookup icimlogs.csv
Works to search with lookup table:

(host=vel*) index=velocity sourcetype="velocity:icim" (source="E:\\logs\\icim\\*" NOT source="E:\\logs\\icim\\2018*") Action  NOT  
[| inputlookup icimlogs.csv] 
| dedup source 
| table source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Combined search that fails (This is just the latest iteration):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=vel*) index=velocity sourcetype="velocity:icim" source="E:\\logs\\icim\\*" ("Transaction Rolled Back" OR "Process FNXML Complete") 
| dedup source 
| stats count by source 
| fields source 
| outputlookup icimlogs.csv 
| append 
    [ search (host=vel*) index=velocity sourcetype="velocity:icim" (source="E:\\logs\\icim\\*" NOT source="E:\\logs\\icim\\2018*") Action NOT 
        [| inputlookup icimlogs.csv]] 
| dedup source 
| table source]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your help, everyone.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340320#M62771</guid>
      <dc:creator>aoleske</dc:creator>
      <dc:date>2018-01-30T21:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340321#M62772</link>
      <description>&lt;P&gt;The extra bracket ']' after [|inputlookup icimlogs.csv] was a typo. I have removed it, and the error is now gone. However, I am still only outputting my original file list, and not the filtered list.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 21:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340321#M62772</guid>
      <dc:creator>aoleske</dc:creator>
      <dc:date>2018-01-30T21:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340322#M62773</link>
      <description>&lt;P&gt;What I have understood you just need one query in order to:&lt;BR /&gt;
i- filter out any files like E:\logs\icim\2018* ===&amp;gt; NOT  source="E:\logs\icim\2018*"&lt;BR /&gt;
ii- filter out files (source) containing "Transaction Rolled Back" OR "Process FNXML Complete" ===&amp;gt;  NOT [|search  index=velocity sourcetype="velocity:icim" (host=vel*) ("Transaction Rolled Back" OR "Process FNXML Complete") | dedup source | fields source]&lt;/P&gt;

&lt;P&gt;So your query would be like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=velocity sourcetype="velocity:icim" (host=vel*)  NOT  source="E:\\logs\\icim\\2018*" NOT [|search  index=velocity sourcetype="velocity:icim" (host=vel*) ("Transaction Rolled Back" OR "Process FNXML Complete") | dedup source | fields source]  | your query continues...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340322#M62773</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2020-09-29T17:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340323#M62774</link>
      <description>&lt;P&gt;Hi Nabeel652! Thank you for the response. I am not sure where I would put that, as I have two queries with index-velocity. I am attempting to really do the following. (Assumption is that all log files are under E:\logs\icom):&lt;BR /&gt;
1) Ignore any log files with "Transaction Rolled Back" OR "Process FNXML Complete" inside the contents.&lt;BR /&gt;
2) Ignore any files that begin with "E:\logs\icim\2018*". &lt;/P&gt;

&lt;P&gt;This leaves me with a small list of files where a transaction did not complete or rollback, and any possible files listing an error of some type. I can then explore any logs that have some form of error and figure out what transaction actually created the problem. Note that a pertinent file may not have the word "error" in it, so I can't just search for "error".&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 14:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340323#M62774</guid>
      <dc:creator>aoleske</dc:creator>
      <dc:date>2018-01-31T14:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340324#M62775</link>
      <description>&lt;P&gt;Ah sorry I got you wrong. Please see my updated answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2018 23:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340324#M62775</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2018-01-31T23:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of source files for use in primary search?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340325#M62776</link>
      <description>&lt;P&gt;Thanks Nabeel652. I have accepted the answer. I used a variation of what you suggested and then discovered that I get a log file with an Oracle disconnect message which listed the pertinent log file directly.  I have lost the original search to the mists of time, or I would post it here. Thanks again for your help!&lt;BR /&gt;
Andrew&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 18:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-a-list-of-source-files-for-use-in-primary-search/m-p/340325#M62776</guid>
      <dc:creator>aoleske</dc:creator>
      <dc:date>2018-02-09T18:58:50Z</dc:date>
    </item>
  </channel>
</rss>

