ApacheLogParser Example: Common LogFormat | Teradata Vantage - ApacheLogParser Example: Common LogFormat - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.