<?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: Filtering data before indexing with script in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-data-before-indexing-with-script/m-p/457054#M78965</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Define the script as a scripted input (Settings-&amp;gt;Data inputs-&amp;gt;Scripts).  Anything the script writes to stdout will be indexed by Splunk.  There are no arguments passed to the script so it must have its own logic to know which log to read.&lt;/LI&gt;
&lt;LI&gt;Yes, you can use transforms.conf.  Use a REGEX statement to identify the events you want to index and send them to &lt;CODE&gt;FORMAT = indexQueue&lt;/CODE&gt;; send the rest to &lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Tue, 20 Aug 2019 13:39:29 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-08-20T13:39:29Z</dc:date>
    <item>
      <title>Filtering data before indexing with script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-data-before-indexing-with-script/m-p/457053#M78964</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I have a very longs logs that I would like to filter before indexing/ I have some patterns that interesting me, however, I don't think that using props.conf and transforms.conf will help me because I want only this event, and they are very different in the strings. I thought to use a bash script that excludes only these events, and I create one that works well.&lt;BR /&gt;
 Currently, I uploading the logs and in the future, I will send them form Amazon S3 cloud. &lt;/P&gt;

&lt;P&gt;I have 2 questions:&lt;BR /&gt;
1. How I define this script in Splunk? how does it know form which folder takes the log and which script to run? &lt;BR /&gt;
2. If 1 is not possible, maybe using transforms.conf regex is possible?&lt;BR /&gt;
for example, these are the only logs pattern that I want to be uploaded:&lt;/P&gt;

&lt;P&gt;ShutdownThread: shutdown reason is: userrequested&lt;BR /&gt;
SystemInfo: boot&lt;BR /&gt;
XCMP    : Tx: PUI broadcast  source:0x1  type:0x0  id:0x1  state:0x1&lt;BR /&gt;
XCMP    : Tx: PUI broadcast  source:0x1  type:0x0  id:0x1  state:0x0&lt;BR /&gt;
CAP:MediaRecorder: Start video recording&lt;BR /&gt;
CAP:MediaRecorder: Stop video recording&lt;BR /&gt;
(I have like 10 different events with ON/OFF string)&lt;BR /&gt;
Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 09:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-data-before-indexing-with-script/m-p/457053#M78964</guid>
      <dc:creator>alisaf</dc:creator>
      <dc:date>2019-08-20T09:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data before indexing with script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-data-before-indexing-with-script/m-p/457054#M78965</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Define the script as a scripted input (Settings-&amp;gt;Data inputs-&amp;gt;Scripts).  Anything the script writes to stdout will be indexed by Splunk.  There are no arguments passed to the script so it must have its own logic to know which log to read.&lt;/LI&gt;
&lt;LI&gt;Yes, you can use transforms.conf.  Use a REGEX statement to identify the events you want to index and send them to &lt;CODE&gt;FORMAT = indexQueue&lt;/CODE&gt;; send the rest to &lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 20 Aug 2019 13:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-data-before-indexing-with-script/m-p/457054#M78965</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-20T13:39:29Z</dc:date>
    </item>
  </channel>
</rss>

