I have a series of logs that have, among other data, the source address from which they come (src_ip) and the session of which they are part (session). How do I get a table showing the total number of unique sessions in which each source IP address is involved?
@gryfon there is no need to add table command which is transforming (non-streaming) command and brings all the data to search head for further processing. So if you have clustered environment with multiple indexers you will not leverage the search performance improvement through parallelization (map) and subsequently no advantage of map-reduce in stats command which merely works on the result of table command in your case. If your index has too many fields, you can try
fields (streaming command) instead of table or directly stats after your main query.
Refer to documentation: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Table#Command_type
PS: I have converted @richgalloway 's comment to answer. Please accept the answer if your issue is resolved.