<?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: remove/change long field before inserting event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705487#M116700</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/Latest/Admin/Propsconf#Field_extraction_configuration" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/Latest/Admin/Propsconf#Field_extraction_configuration&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SEDCMD-&amp;lt;class&amp;gt; = &amp;lt;sed script&amp;gt;
* Only used at index time.
* Commonly used to anonymize incoming data at index time, such as credit
  card or social security numbers. For more information, search the online
  documentation for "anonymize data."
* Used to specify a sed script which Splunk software applies to the _raw
  field.
* A sed script is a space-separated list of sed commands. Currently the
  following subset of sed commands is supported:
    * replace (s) and character substitution (y).
* Syntax:
    * replace - s/regex/replacement/flags
      * regex is a perl regular expression (optionally containing capturing
        groups).
      * replacement is a string to replace the regex match. Use \n for back
        references, where "n" is a single digit.
      * flags can be either: g to replace all matches, or a number to
        replace a specified match.
    * substitute - y/string1/string2/
      * substitutes the string1[i] with string2[i]
* No default.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2024 15:21:22 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-11-28T15:21:22Z</dc:date>
    <item>
      <title>remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705394#M116681</link>
      <description>&lt;P&gt;i have events that contains a specific field that sometimes contain a very long field which make the rest of the event be truncated, i want to remove this field or change it "long field detected".&lt;/P&gt;&lt;P&gt;the problematic field call "file" and i should catch it's last appearnce, also i want the data after it so i should stop the removal after the first "," (comma). also the event contains nested fields.&lt;/P&gt;&lt;P&gt;i've tried props.conf+transform conf like that:ete&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;here is an example for 1 event:&lt;BR /&gt;deleted due to security reasons&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 15:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705394#M116681</guid>
      <dc:creator>dorHerbesman</dc:creator>
      <dc:date>2025-07-02T15:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705413#M116690</link>
      <description>&lt;P&gt;The REGEX does not match the sample data because backslashes must be escaped.&amp;nbsp; Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;REGEX = \\"file\\":\s*\\"(.{5000,}?),"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Nov 2024 15:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705413#M116690</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-11-27T15:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705416#M116691</link>
      <description>&lt;P&gt;This way you can only (if the regex matches) extract indexed field, not modify the original event (maybe except when you overwrite the _raw event).&lt;/P&gt;&lt;P&gt;You're looking for the SEDCMD functionality. I'd also slightly modify your regex since you're looking for a base64-encoded contents which may not contain neither backslash nor a quote.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-trim-file = s/(\\"file\\":\s*\\")([^\\"]{5000,}?)/\1long_file/g&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;See it here&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/8nX7FY/1" target="_blank"&gt;https://regex101.com/r/8nX7FY/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(the regex101 substitution uses a bit different format to SEDCMD - it uses $1 instead of \1)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 15:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705416#M116691</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-27T15:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705478#M116699</link>
      <description>&lt;P&gt;is this props.conf/transform.conf command or in splunk command? the goal is to remove/alter the field prior entering it to splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 11:20:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705478#M116699</guid>
      <dc:creator>dorHerbesman</dc:creator>
      <dc:date>2024-11-28T11:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705487#M116700</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/Latest/Admin/Propsconf#Field_extraction_configuration" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/Latest/Admin/Propsconf#Field_extraction_configuration&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SEDCMD-&amp;lt;class&amp;gt; = &amp;lt;sed script&amp;gt;
* Only used at index time.
* Commonly used to anonymize incoming data at index time, such as credit
  card or social security numbers. For more information, search the online
  documentation for "anonymize data."
* Used to specify a sed script which Splunk software applies to the _raw
  field.
* A sed script is a space-separated list of sed commands. Currently the
  following subset of sed commands is supported:
    * replace (s) and character substitution (y).
* Syntax:
    * replace - s/regex/replacement/flags
      * regex is a perl regular expression (optionally containing capturing
        groups).
      * replacement is a string to replace the regex match. Use \n for back
        references, where "n" is a single digit.
      * flags can be either: g to replace all matches, or a number to
        replace a specified match.
    * substitute - y/string1/string2/
      * substitutes the string1[i] with string2[i]
* No default.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 15:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705487#M116700</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-28T15:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: remove/change long field before inserting event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705676#M116723</link>
      <description>&lt;P&gt;That's a good direction! unfortunately still not working 100% , i used your code in my props.conf :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[APIGW]
SEDCMD-trim-file = s/(\\"file\\":\s*\\")([^\\"]{5000,}?)/\1long_file/g&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;and here are the results:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;it's like it only replace the 5000 first character instead the entire filed but this is a big step in the right direction thank you for your help!&lt;BR /&gt;i will try taking it from here but it will be mostly appreciated if you have the solution in you mind and can share it&lt;BR /&gt;&lt;BR /&gt;EDIT:&amp;nbsp;&lt;BR /&gt;From a few tests I've made it stops the field change exactly after 5000 characters instead of running till the first comma / end of field.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;EDIT2:&amp;nbsp;&lt;BR /&gt;the regex that was needed was:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-trim-file = s/(\\"file\\":\s*\\")([^\\"]{5000,})(\\")/\1long_file/g&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;but thank you for all the help!&lt;BR /&gt;&lt;BR /&gt;EDIT3:&lt;BR /&gt;Well, apparently this solution alone is not enough, I also had to increase the truncate value because when the secmd command run it replaces the string&amp;nbsp; at the end meaning it first recive the default 10,000 characters and only than replace which is not good enough because the final result is still truncated events, i needed to increase truncate value so it will recive the entire event and later on it's doing the replacement.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2025 15:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/remove-change-long-field-before-inserting-event/m-p/705676#M116723</guid>
      <dc:creator>dorHerbesman</dc:creator>
      <dc:date>2025-07-02T15:18:24Z</dc:date>
    </item>
  </channel>
</rss>

