FormatOps.
More...
#include <formats.h>
|
const std::string | parseApacheEscapes (const std::string &string, const bool &strftime=false) |
| Parses the escapes (backslashes) and returns the resulting string. More...
|
|
const std::string | parseNginxEscapes (const std::string &string) |
| Parses the escapes (backslashes) and returns the resulting string. More...
|
|
const int | countNewLines (const std::string &initial, const std::string &final, const std::vector< std::string > &separators) |
| Conuts how many new lines are there in the format. More...
|
|
const size_t | findNginxFieldEnd (const std::string &string, const int &start) |
| Finds the end of a Nginx log field. More...
|
|
void | checkIisString (const std::string &string) |
| Checks whether the format string contains invalid characters or not. More...
|
|
|
const std::unordered_map< std::string, std::string > | APACHE_ALF |
| < Access logs fields formats More...
|
|
const std::unordered_map< std::string, std::string > | NGINX_ALF |
| < Access logs fields formats
|
|
const std::unordered_map< std::string, std::string > | IIS_ALF |
| < Access logs fields formats
|
|
FormatOps.
Operations for the logs formats
◆ checkIisString()
void FormatOps::checkIisString |
( |
const std::string & |
string | ) |
|
|
private |
Checks whether the format string contains invalid characters or not.
- Parameters
-
- Exceptions
-
- See also
- processIisFormatString
◆ countNewLines()
const int FormatOps::countNewLines |
( |
const std::string & |
initial, |
|
|
const std::string & |
final, |
|
|
const std::vector< std::string > & |
separators |
|
) |
| |
|
private |
Conuts how many new lines are there in the format.
Used to join log lines which refer to the same log line
- Parameters
-
initial | The initial separator |
final | The final separator |
separators | The separators in the middle |
- Returns
- The number of new lines in a single log line
- See also
- LogsFormat, processApacheFormatString(), processNginxFormatString()
◆ findNginxFieldEnd()
const size_t FormatOps::findNginxFieldEnd |
( |
const std::string & |
string, |
|
|
const int & |
start |
|
) |
| |
|
private |
Finds the end of a Nginx log field.
- Parameters
-
string | The format string |
start | The starting point of the field in the string |
- Returns
- The ending poin of the field in the string
- See also
- processNginxFormatString()
◆ getApacheLogSample()
const QString FormatOps::getApacheLogSample |
( |
const LogsFormat & |
log_format | ) |
|
◆ getIisLogSample()
const QString FormatOps::getIisLogSample |
( |
const LogsFormat & |
log_format | ) |
|
◆ getNginxLogSample()
const QString FormatOps::getNginxLogSample |
( |
const LogsFormat & |
log_format | ) |
|
◆ parseApacheEscapes()
const std::string FormatOps::parseApacheEscapes |
( |
const std::string & |
string, |
|
|
const bool & |
strftime = false |
|
) |
| |
|
private |
Parses the escapes (backslashes) and returns the resulting string.
Used to obtain the same result as on Apache2
- Parameters
-
string | The string to parse |
strftime | Whether to apply the strftime special rule when parsing or not |
- Returns
- The resulting string
- Exceptions
-
- See also
- processApacheFormatString()
◆ parseNginxEscapes()
const std::string FormatOps::parseNginxEscapes |
( |
const std::string & |
string | ) |
|
|
private |
Parses the escapes (backslashes) and returns the resulting string.
Used to obtain the same result as on Nginx
- Parameters
-
string | The string to parse |
- Returns
- The resulting string
- Exceptions
-
- See also
- processNginxFormatString()
◆ processApacheFormatString()
Processes the given string to extrapolate the format for Apache2.
- Parameters
-
format_string | The format string to process |
- Returns
- The logs format
- Exceptions
-
- See also
- LogsFormat
◆ processIisFormatString()
const FormatOps::LogsFormat FormatOps::processIisFormatString |
( |
const std::string & |
format_string, |
|
|
const int & |
log_module |
|
) |
| |
Processes the given string to extrapolate the format for the IIS.
- Parameters
-
format_string | The format string to process |
log_module | The ID of the log module to use |
- Returns
- The logs format
- Exceptions
-
- See also
- LogsFormat
◆ processNginxFormatString()
Processes the given string to extrapolate the format for Nginx.
- Parameters
-
format_string | The format string to process |
- Returns
- The logs format
- Exceptions
-
- See also
- LogsFormat
◆ APACHE_ALF
const std::unordered_map<std::string, std::string> FormatOps::APACHE_ALF |
|
private |
< Access logs fields formats
Composed access logs fields formats
The documentation for this class was generated from the following files:
- logdoctor/modules/craplog/modules/formats.h
- logdoctor/modules/craplog/modules/formats.cpp