I'm trying you create a variable out of a search result using eval.
This works fine, I get a single row, and a column with error lines:
search index=sap_log_index message_type="E" | eventstats list(message_text) as errorLines | nomv errorLines | dedup errorLines | table errorLines
But the below search fails with malformed exception:
index="sap_idoc_index" | eval errorLines=[search index=sap_log_index message_type="E" | eventstats list(message_text) as errorLines | nomv errorLines | dedup errorLines | return $errorLines] | eval error_msg = if(Status=="41", errorLines, ""), status = if(Status=="41", "Failed", "Success") | table idoc_number, status, error_msg
... View more