I have the following question regarding using the sendemail command together with the 'map' one. Using the below search I managed to send the data to respective recipients based on the results, however, when there are no results no email is being sent. | inputlookup 'email_addresses + name.csv'
| map
[search index=test_index
| search name="$name$"
| fields name title attributes
| stats count(eval(case(attribute="A", 1))) as "Attribute A" count(eval(case(attribute="B", 1))) as "Attribure B" count by name title _time
| eval _time=strftime(_time, "%+")
| appendpipe [stats count | where count=0 ]
| sendemail bcc="$email_address$" subject="Table $name$ | _time" sendresults=true inline=true format=table lookup contains two columns: email_address and name I tried different scenarios but using for example makeresults, appendpipe to insert dummy data in case no results are returned, but all caused a duplication of the email being sent, where the second email is missing the tokenization specified in the sendemail command.
... View more