Count multiple informations with date range from mail.log.xy.gz [on hold]











up vote
0
down vote

favorite












is there one line possibility or script to count multiple informations for selected emails?
For example I have



foo@example.com
newbie@example.com


And I need to count for both Sent emails in some time period and Delivered emails. From September, October, November.



I tryed manualy for one month and one email this:



zcat  /var/log/mail.*.gz | grep "foo@example.com" |  sed -n '/2018-09-01/,/2018-09-31/p' /var/log/mail.* | grep delivered | uniq -c | wc -l


But unfortunately with no output.










share|improve this question















put on hold as unclear what you're asking by Jeff Schaller, JigglyNaga, roaima, Kusalananda, Mr Shunz yesterday


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 5




    It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
    – Pierre-Alain TORET
    yesterday










  • Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
    – JigglyNaga
    yesterday










  • You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
    – roaima
    yesterday












  • There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
    – roaima
    yesterday















up vote
0
down vote

favorite












is there one line possibility or script to count multiple informations for selected emails?
For example I have



foo@example.com
newbie@example.com


And I need to count for both Sent emails in some time period and Delivered emails. From September, October, November.



I tryed manualy for one month and one email this:



zcat  /var/log/mail.*.gz | grep "foo@example.com" |  sed -n '/2018-09-01/,/2018-09-31/p' /var/log/mail.* | grep delivered | uniq -c | wc -l


But unfortunately with no output.










share|improve this question















put on hold as unclear what you're asking by Jeff Schaller, JigglyNaga, roaima, Kusalananda, Mr Shunz yesterday


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 5




    It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
    – Pierre-Alain TORET
    yesterday










  • Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
    – JigglyNaga
    yesterday










  • You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
    – roaima
    yesterday












  • There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
    – roaima
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











is there one line possibility or script to count multiple informations for selected emails?
For example I have



foo@example.com
newbie@example.com


And I need to count for both Sent emails in some time period and Delivered emails. From September, October, November.



I tryed manualy for one month and one email this:



zcat  /var/log/mail.*.gz | grep "foo@example.com" |  sed -n '/2018-09-01/,/2018-09-31/p' /var/log/mail.* | grep delivered | uniq -c | wc -l


But unfortunately with no output.










share|improve this question















is there one line possibility or script to count multiple informations for selected emails?
For example I have



foo@example.com
newbie@example.com


And I need to count for both Sent emails in some time period and Delivered emails. From September, October, November.



I tryed manualy for one month and one email this:



zcat  /var/log/mail.*.gz | grep "foo@example.com" |  sed -n '/2018-09-01/,/2018-09-31/p' /var/log/mail.* | grep delivered | uniq -c | wc -l


But unfortunately with no output.







grep logs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Jeff Schaller

37.9k1053123




37.9k1053123










asked yesterday









Delirium

7118




7118




put on hold as unclear what you're asking by Jeff Schaller, JigglyNaga, roaima, Kusalananda, Mr Shunz yesterday


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as unclear what you're asking by Jeff Schaller, JigglyNaga, roaima, Kusalananda, Mr Shunz yesterday


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 5




    It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
    – Pierre-Alain TORET
    yesterday










  • Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
    – JigglyNaga
    yesterday










  • You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
    – roaima
    yesterday












  • There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
    – roaima
    yesterday














  • 5




    It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
    – Pierre-Alain TORET
    yesterday










  • Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
    – JigglyNaga
    yesterday










  • You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
    – roaima
    yesterday












  • There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
    – roaima
    yesterday








5




5




It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
– Pierre-Alain TORET
yesterday




It's hard to tell what is wrong, if you don't give at least one line of the file your trying to count occurences in.
– Pierre-Alain TORET
yesterday












Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
– JigglyNaga
yesterday




Does the logfile have the date and sender address on the same line? And did every user send at least one email on the first day of every month? If the answer to either of these is "no", then you're not going to see any output.
– JigglyNaga
yesterday












You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
– roaima
yesterday






You can't provide stdin to your sed command AND have it read the files directly. (Well you can - you are - but it won't work as you seem to expect.)
– roaima
yesterday














There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
– roaima
yesterday




There's little point using uniq -c instead of uniq if all you're then going to do is to pipe in into wc -l. Perhaps you want to add up the unique occurrences rather than count how many different groups there are? Please provide an EXAMPLE consisting of several lines of your source data along with the expected result for that data set.
– roaima
yesterday















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Entries order in /etc/network/interfaces

新発田市

Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)