code_junkie

How can I parse Serv-U FTP logs with SSIS

Nov 13th, 2011
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. SELECT TO_Timestamp(REPLACE_STR(STRCAT(STRCAT(date,' '), time),' GMT',''),'yyyy-M-d h:m:s') as DateTime, [client-ip], [Client-hostname], [Partner-name], [Server-hostname], [server-IP], [Recipient-Address], [Event-ID], [MSGID], [Priority], [Recipient-Report-Status], [total-bytes], [Number-Recipients], TO_Timestamp(REPLACE_STR([Origination-time], ' GMT',''),'yyyy-M-d h:m:s') as [Origination Time], Encryption, [service-Version], [Linked-MSGID], [Message-Subject], [Sender-Address] INTO '%outfile%' FROM '%infile%' WHERE [Event-ID] IN (1027;1028)
  2.  
  3. logparser.exe file:c:exchangeinfoname_of_file_goes_here.sql?infile=c:exchangeinfologs*.log+outfile=c:exchangeinfologsname_of_file_goes_here.bcp -i:W3C -o:TSV
  4.  
  5. bcp databasename.dbo.table in c:exchangeinfologsname_of_file_goes_here.bcp -c -t"t" -T -F 2 -S serverinstance -U userid -P password
Add Comment
Please, Sign In to add comment