function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DannyK88DannyK88 

Get number of emails sent from salesforce using email logs

I have been searching everywhere and have not been able to find any information on this. So I was asked to get a current number of emails that my company has sent from Salesforce. When doing research I found that the only way to do that was using the Email Logs. So I downloaded email logs for the day. I found them very difficult to read and understand. I found this documentation but this didn't help me get a number of emails sent. https://help.salesforce.com/HTViewHelpDoc?id=email_logs_format.htm&language=en_US 

I would imagine that emails only count once regardless if there are muliple people in the To and BCC email fields, however I could be wrong about that. If someone could help me understand the email logs better and get an accurate count of how many emails were sent from our salesforce system that would be super helpful. 

Thanks,
DannyK88
KevinPKevinP
Danny,

I can't speak authoritatively regarding multiple address == 1 email send but from a logical perspective i feel like its a safe bet. 

Regarding the log files, you want to count the number of unique entries in column "I" (as in eye). 

Once you've got the log file you can use the unix/linux/osX standard tools WC and Awk to parse it into your number thusly:
 
awk -F , '{ a[$9]++ } END { for (b in a) { print b } }' /path/to/file | wc -l