<?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: Script to filter events at index time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707139#M116918</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/211891"&gt;@ktn01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the only solution is apply INGEST_EVAL rules to your input, instead a python script.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2024 10:18:18 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-12-18T10:18:18Z</dc:date>
    <item>
      <title>Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707135#M116914</link>
      <description>&lt;P&gt;Is it possible to use a python script to perform transforms during event indexing?&lt;/P&gt;&lt;P&gt;My aim is to remove keys from json files to reduce volume. I'm thinking of using a python script that decodes the json, modifies the resulting dict and then encodes the result in a new json that will be indexed.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 09:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707135#M116914</guid>
      <dc:creator>ktn01</dc:creator>
      <dc:date>2024-12-18T09:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707136#M116915</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/211891"&gt;@ktn01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes, it's possible, but it isn't related to Splunk because it pre-processes data before ingestion: I did it for a customer.&lt;/P&gt;&lt;P&gt;Put attention to one issue: changing the format of your logs, you have to completely rebuild the parsing rules for your data because the standard parsing rules aren't still applicable to the new data format.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 09:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707136#M116915</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-12-18T09:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707137#M116916</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;BR /&gt;I can't pre-process the events before ingestion in Splunk because they are directly sent by an appliance to a hec input.&lt;BR /&gt;Christian&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 10:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707137#M116916</guid>
      <dc:creator>ktn01</dc:creator>
      <dc:date>2024-12-18T10:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707138#M116917</link>
      <description>&lt;P&gt;Yes, you can achieve this by using a Python script as a &lt;STRONG&gt;scripted input&lt;/STRONG&gt; in Splunk. You can read the data using Python, perform the modifications as you described (decoding the JSON, updating the dictionary, and re-encoding it), and output the modified data.&lt;/P&gt;&lt;P&gt;Here's how it works:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Python Script:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Read the incoming data.&lt;/LI&gt;&lt;LI&gt;Apply the necessary transformations.&lt;/LI&gt;&lt;LI&gt;Print the modified JSON to standard output (stdout).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Configure Scripted Input in Splunk:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go to &lt;STRONG&gt;Settings &amp;gt; Data Inputs &amp;gt; Scripts&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Add a new scripted input and select your Python script.&lt;/LI&gt;&lt;LI&gt;Set a &lt;STRONG&gt;cron schedule&lt;/STRONG&gt; for when the script should run.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The script will run at the configured intervals, fetch the data, apply your changes, and send the transformed data to Splunk for indexing.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Important Consideration:&lt;/STRONG&gt;&lt;BR /&gt;The main limitation is that data ingestion will depend on the cron schedule of the scripted input, so real-time or very frequent data processing might not be achievable. Adjust the schedule as needed based on your data update frequency.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 10:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707138#M116917</guid>
      <dc:creator>Jawahir</dc:creator>
      <dc:date>2024-12-18T10:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707139#M116918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/211891"&gt;@ktn01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;the only solution is apply INGEST_EVAL rules to your input, instead a python script.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 10:18:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707139#M116918</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-12-18T10:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script to filter events at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707201#M116932</link>
      <description>Is it possible to ask that sender reduce content of HEC event or is it used somewhere else also?</description>
      <pubDate>Wed, 18 Dec 2024 18:15:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-to-filter-events-at-index-time/m-p/707201#M116932</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-12-18T18:15:51Z</dc:date>
    </item>
  </channel>
</rss>

