I have the following search:
index=ad source=otl_adgroupmemberscan memberSamAccountName=jbloggs
|dedup memberSamAccountName, groupSamAccountName
|table groupSamAccountName, memberSamAccountName
If there are no results, I want it to show a field that have a value of zero.
If there are results though, it's important the search still returns all of the values of groupSamAccountName and memberSamAccountName
index=ad source=otl_adgroupmemberscan memberSamAccountName=jbloggs
|dedup memberSamAccountName, groupSamAccountName
|table groupSamAccountName, memberSamAccountName
| appendpipe [ stats count | eval "NoResults"="0" | where count=0 |table "NoResults"]
you could name the "NoResults" field to groupSamAccountName or memberSamAccountName and it would replace that field value if there are no results.
index=ad source=otl_adgroupmemberscan memberSamAccountName=jbloggs
|dedup memberSamAccountName, groupSamAccountName
|table groupSamAccountName, memberSamAccountName
| appendpipe [ stats count | eval "NoResults"="0" | where count=0 |table "NoResults"]
you could name the "NoResults" field to groupSamAccountName or memberSamAccountName and it would replace that field value if there are no results.
Thank you! this worked exactly how I wanted it to.