1.1 - 8.10 - ApacheLogParser Example: Common LogFormat - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

SQL Call

The common log format excludes some columns from the default extended format.

SELECT * FROM ApacheLogParser (
  ON apache_logs
  USING
  TargetColumn ('logdata')
  LogFormat ('%h %l %u %t \"%r\" %>s %O')
  SearchInfoFlag ('true')
) AS dt;

Output

The Referer, User-Agent name, search engine and search terms are absent in the common log format output.

 remote_host   remote_log_name remote_user request_time               requested_page     final_status bytes_sent_including_header 
 ------------- --------------- ----------- -------------------------- ------------------ ------------ --------------------------- 
 127.0.0.1     -               -           2000-10-10 13:55:36.000000 /apache_pb.gif     200          2326                       
 75.36.209.106 -               Patrick     2008-05-20 15:43:57.000000 /                  200          15251                      
 69.236.77.51  -               Frank       2011-03-26 09:17:31.000000 /about/careers.php 200          5976                       
 168.187.7.114 -               Lewis       2011-03-27 00:16:49.000000 /                  200          7203

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.