Getting Data In

How to resolve error "string index out of range" when anonymizing a diag?

arowsell_splunk
Splunk Employee
Splunk Employee

When anonymizing a diag as per the following:

https://docs.splunk.com/Documentation/Splunk/6.5.0/Troubleshooting/AnonymizedatasamplestosendtoSuppo...

An error is encountered on certain log files:

Error reading file /Users/arowsell/Documents/xxtest/ananon_diag_test//test_fail_1_event_bad.log and getting terms: string index out of range

Steps to reproduce:

1) Run following command on attached file test_fail_1_event_bad.log:

find pathtomyuncompresseddiag/ -name *.log* | xargs -I{} ./splunk anonymize file -source '{}'

2) Run the same command on the file test_fail_1_event_good.log and the error does not occur.

The only difference between the files seem to be the trailing white spaces at the end of the event.

0 Karma
1 Solution

arowsell_splunk
Splunk Employee
Splunk Employee

The following bug was raised for this matter:

SPL-131827 : Error when anonymizing diag "string index out of range"

The error can be resolved by making the following changes

  • Open the file $SPLUNK_HOME/bin/scrubber.py
  • Look for MAX_SEGMENT = 1024 - change it to MAX_SEGMENT = 4096

Then re-run the anonymizing command

View solution in original post

arowsell_splunk
Splunk Employee
Splunk Employee

The following bug was raised for this matter:

SPL-131827 : Error when anonymizing diag "string index out of range"

The error can be resolved by making the following changes

  • Open the file $SPLUNK_HOME/bin/scrubber.py
  • Look for MAX_SEGMENT = 1024 - change it to MAX_SEGMENT = 4096

Then re-run the anonymizing command

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...