Forum Discussion
tomascorey
Mar 12, 2020Copper Contributor
LogParser date-time with another fields
Hello, My name is Tomas, I try to combine SELECT With date-time but when I try to organize by group and order I have this error: Command: PS C:\Program Files (x86)\Log Parser 2....
tomascorey
Mar 25, 2020Copper Contributor
JeremyTBradshaw Thanks for your repply. Finally!, I can make works.
There are logparser code, work for me.
./LogParser.exe "SELECT EXTRACT_PREFIX(remote-endpoint,0,':') as IP,REVERSEDNS(EXTRACT_PREFIX(remote-endpoint,0,':')) as Name, COUNT(*) AS Hits, TO_LOCALTIME(TO_TIMESTAMP(EXTRACT_PREFIX(TO_STRING([#Fields: date-time]),0,'T'), 'yyyy-MM-dd')) AS LogDate from 'C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive\*.log' WHERE data LIKE '%EHLO%' GROUP BY LogDate,IP ORDER BY Hits DESC" -i:CSV -nSkipLines:4 -O:CSV >> c:\temp\ReceiveConnectorMailFlow25032020.csv
Best Regards,
Tomás Esteban Corey
JeremyTBradshaw
Mar 25, 2020Iron Contributor
Awesome, glad to hear.