Splunk Search

Flush on search custom command not working

rleoneti
New Member

I try to use flush on custom command and not working.

I used generatetext.py from searchcommands_app and put self.flush() and the search done with errors.

    def generate(self):
        text = self.text
        self.logger.debug("Generating %d events with text %s" % (self.count, self.text))
        for i in range(1, self.count + 1):
            yield {'_serial': i, '_time': time.time(), '_raw': six.text_type(i) + '. ' + text}
            self.flush()

Error:

02-20-2020 14:32:12.814 INFO  ReducePhaseExecutor - ReducePhaseExecutor=1 action=PREVIEW
02-20-2020 14:32:12.990 INFO  ReducePhaseExecutor - ReducePhaseExecutor=1 action=PREVIEW
02-20-2020 14:32:12.990 ERROR ChunkedExternProcessor - Failed to write buffer of size 17 to external process file descriptor (The pipe is being closed.)
02-20-2020 14:32:13.024 ERROR ChunkedExternProcessor - Failure writing result chunk, buffer full. External process possibly failed to read its stdin.
02-20-2020 14:32:13.024 ERROR ChunkedExternProcessor - Error in 'generatetext' command: Failed to send message to external search command, see search.log.
02-20-2020 14:32:13.024 INFO  ReducePhaseExecutor - Ending phase_1
02-20-2020 14:32:13.024 INFO  UserManager - Unwound user context: admin -> NULL
02-20-2020 14:32:13.024 ERROR SearchOrchestrator - Phase_1 failed due to : Error in 'generatetext' command: Failed to send message to external search command, see search.log.
02-20-2020 14:32:13.025 INFO  ReducePhaseExecutor - ReducePhaseExecutor=1 action=CANCEL
02-20-2020 14:32:13.025 INFO  DispatchExecutor - User applied action=CANCEL while status=0
02-20-2020 14:32:13.025 ERROR SearchStatusEnforcer - sid:1582219925.18 Error in 'generatetext' command: Failed to send message to external search command, see search.log.
02-20-2020 14:32:13.025 INFO  SearchStatusEnforcer - State changed to FAILED due to: Error in 'generatetext' command: Failed to send message to external search command, see search.log.
02-20-2020 14:32:13.090 INFO  UserManager - Unwound user context: admin -> NULL

Any Help ??

0 Karma
Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...