https://github.com/vcputtini/squidlogparser
A small object library capable of interpreting the log entries generated by Squid-cache(tm) and manipulating this data.
https://github.com/vcputtini/squidlogparser
cpp cpp17 http http-proxy https lib library parser squid squid-proxy
Last synced: 3 months ago
JSON representation
A small object library capable of interpreting the log entries generated by Squid-cache(tm) and manipulating this data.
- Host: GitHub
- URL: https://github.com/vcputtini/squidlogparser
- Owner: vcputtini
- Created: 2022-03-09T16:41:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-22T19:15:47.000Z (almost 3 years ago)
- Last Synced: 2025-01-22T09:34:10.451Z (5 months ago)
- Topics: cpp, cpp17, http, http-proxy, https, lib, library, parser, squid, squid-proxy
- Language: C++
- Homepage:
- Size: 1.12 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## SquidLogParser
This library is a basic one for analyzing and retrieving information from the fields of the Squid-cache(tm) log entries.
Currently only internally predefined formats are supported: squid; common; combined; referrer and useragent.
This is not a generic library and has not been tested in environments other than the one used in its development.SquidLogParser was coded entirely in C++.
As I consider QtCreator(tm) to be an excellent development environment,
I use it for my projects, even if these don't directly involve using the Qt(tm) tools.### Dependencies for Compilation:
- At least C++17.
- Boost
- Tinyxml-2
- MariaDB Connector C++ 1.0.1 or greater for SLPDatabase (Optional)### My Environment
- Fedora 36
- clang version 14.0.0
- g++ (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)
(Under Oracle Linux 8 install gcc-devtool-10 or 8.6 install gcc-devtool-11)
- cmake version 3.22.x
- QtCreator 7.0.x (Code Style: clang-format -style=Mozilla)### Examples
Small programs are provided with examples in the 'examples/' folder of this project.
### Basic Operations
- Loads entire log file into memory and check that the log entries are with the correct format;
- Allows query of log entries given a condition or regex.
- Allows export of log entries to a XML file format.
- (NEW) Allows export log entries to tables in a MariaDB(tm) database.
The tables are preconfigured by the object. See
[README_SLPDatabase](./README_SLPDatabase.md) for more details.### Objects
- SquidLogParser
- Constructor
- explicit SquidLogParser(LogFormat log_fmt_ )
- Public Members
- append()
- errNum()
- getErrorText()
- size()
- clear()
- getPartInt()
- getPartUint()
- getPartStr()
- addrToNumeric()
- numericToAddr()
- unixTimestamp()
- unixToSquidDate()
- toXML()
- ShowDecodedUrl(URL)- SLPQuery
- Constructor
- explicit SLPQuery(SquidLogParser* obj_);
- Public Members
- select()
- field()
- getInt()
- getUInt()
- getStr()
- sumTotalSizeReply()
- sumResponseTime()
- countByReqMethod()
- countByHttpCdodes()
- HttpRequestCodes_V getHRCDetails()
- countByFiletype()
- getIndexByFiletype()
- getFTDetails()
- numFiletypes()
- totalFiles()
- MethodText()
- size()
- clear()
- ShowDecodedUrl(URL)- SLPDatabase
- Constructor
- explicit SLPDatabase(LogFormat format_, const std::string& dbase_, const std::string& host_, const int& port_, const std::string& user_, const std::string& pass_, const std::string& table_);
- Public Members
- insert()
- dataIngest()
- createTable(bool)
- getRowsInserted()
- resetRowsInserted()
- errorNum()
- getErrorText()- SLPUrlParts
- Constructor
- explicit SLPUrlParts(const std::string rawUrl_);
- Public Members
- getScheme()
- getDomain()
- getUsername()
- getPassword()
- getPath()
- getQuery()
- getFragment()