0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ApacheLogParser.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef HYPERTABLE_APACHELOGPARSER_H
23 #define HYPERTABLE_APACHELOGPARSER_H
24 
25 #include <string>
26 
27 #include <boost/iostreams/device/file.hpp>
28 #include <boost/iostreams/filtering_stream.hpp>
29 
30 #include <fstream>
31 #include <iostream>
32 
33 namespace Hypertable {
34 
36  public:
37  char *ip_address;
38  char *userid;
39  struct tm tm;
40  char *request;
42  char *object_size;
43  char *referer;
44  char *user_agent;
45  };
46 
48 
49  public:
50  void load(std::string filename);
51  bool next(ApacheLogEntry &entry);
52 
53  private:
54  char *extract_field(char *base, char **field_ptr);
55  char *extract_timestamp(char *base, struct tm *tmp);
56 
57  boost::iostreams::filtering_istream m_fin;
58  std::string m_line;
59  };
60 
61 }
62 
63 #endif // HYPERTABLE_APACHELOGPARSER_H
static String filename
Definition: Config.cc:48
bool next(ApacheLogEntry &entry)
char * user_agent
char * userid
struct tm tm
char * request
char * object_size
char * extract_timestamp(char *base, struct tm *tmp)
boost::iostreams::filtering_istream m_fin
char * extract_field(char *base, char **field_ptr)
char * response_code
Hypertable definitions
void load(std::string filename)
char * referer
char * ip_address