Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Searchcommand does not support empty body anymore in v1.6.15 #376

Closed
@knibbl

Description

@knibbl

Describe the bug
Empty body in function _execute_chunk_v2 is not supported anymore.
In previous versions we had an EventingCommand that produced results even when the body was empty.
After upgrading to 1.6.15 this doesn't work anymore, see code below.

v1.6.14:

                if len(mv_fieldnames) == 0:
                    for values in reader:
                        yield OrderedDict(izip(fieldnames, values))
                else:
                    for values in reader:
                        record = OrderedDict()
                        for fieldname, value in izip(fieldnames, values):
                            if fieldname.startswith('__mv_'):
                                if len(value) > 0:
                                    record[mv_fieldnames[fieldname]] = self._decode_list(value)
                            elif fieldname not in record:
                                record[fieldname] = value
                        yield record

v1.6.15:

            if len(body) <= 0:
                return

This issue was very hard to debug for us, because no error was thrown when our custom command gets executed.
It seems like the execution of our command was successful, because of the return statement.
If this behavior is expected an error message would be helpful for debugging.

Removing line 968 from version 1.6.15 would solve the issue.

To Reproduce
Steps to reproduce the behavior:

| customcmd
This produced results in 1.6.14 but not in 1.6.15 anymore.
A workaround was:
| stats count | customcdm

Expected behavior
Deliver results even without input.

Logs or Screenshots

Splunk (please complete the following information):

  • Version: latest
  • OS: CentOS8
  • Deployment: Distributed Env

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions