Analyzes logs using AI to provide insights.
More...
#include <LogAnalyzer.hpp>
|
| | LogAnalyzer (std::shared_ptr< AIServiceWrapper > aiService) |
| |
| std::string | Analyze (AnalysisType type, size_t maxEvents=100, const std::vector< unsigned long > *filteredIndices=nullptr) |
| | Perform analysis on current log data.
|
| |
| std::string | AnalyzeWithCustomPrompt (const std::string &customPrompt, size_t maxEvents=100, const std::vector< unsigned long > *filteredIndices=nullptr) |
| | Perform analysis with custom user-defined prompt.
|
| |
| bool | IsReady () const |
| | Check if AI service is ready.
|
| |
|
| std::string | FormatEventsForAI (size_t maxEvents, const std::vector< unsigned long > *filteredIndices) const |
| |
| void | FormatSingleEvent (std::ostringstream &oss, size_t index, const nlohmann::json &eventJson) const |
| |
| std::string | BuildPrompt (AnalysisType type, const std::string &logData) const |
| |
Analyzes logs using AI to provide insights.
◆ AnalysisType
| Enumerator |
|---|
| Summary | |
| ErrorAnalysis | |
| PatternDetection | |
| RootCause | |
| Timeline | |
◆ LogAnalyzer()
◆ Analyze()
| std::string ai::LogAnalyzer::Analyze |
( |
AnalysisType |
type, |
|
|
size_t |
maxEvents = 100, |
|
|
const std::vector< unsigned long > * |
filteredIndices = nullptr |
|
) |
| |
Perform analysis on current log data.
- Parameters
-
| type | Type of analysis to perform |
| maxEvents | Maximum number of events to include (0 = all) |
| filteredIndices | Optional: specific event indices to analyze (respects user filters) |
- Returns
- Analysis results as text
◆ AnalyzeWithCustomPrompt()
| std::string ai::LogAnalyzer::AnalyzeWithCustomPrompt |
( |
const std::string & |
customPrompt, |
|
|
size_t |
maxEvents = 100, |
|
|
const std::vector< unsigned long > * |
filteredIndices = nullptr |
|
) |
| |
Perform analysis with custom user-defined prompt.
- Parameters
-
| customPrompt | User-provided analysis prompt |
| maxEvents | Maximum number of events to include (0 = all) |
| filteredIndices | Optional: specific event indices to analyze (respects user filters) |
- Returns
- Analysis results as text
◆ BuildPrompt()
| std::string ai::LogAnalyzer::BuildPrompt |
( |
AnalysisType |
type, |
|
|
const std::string & |
logData |
|
) |
| const |
|
private |
◆ FormatEventsForAI()
| std::string ai::LogAnalyzer::FormatEventsForAI |
( |
size_t |
maxEvents, |
|
|
const std::vector< unsigned long > * |
filteredIndices |
|
) |
| const |
|
private |
◆ FormatSingleEvent()
| void ai::LogAnalyzer::FormatSingleEvent |
( |
std::ostringstream & |
oss, |
|
|
size_t |
index, |
|
|
const nlohmann::json & |
eventJson |
|
) |
| const |
|
private |
◆ GetAnalysisTypeName()
| std::string ai::LogAnalyzer::GetAnalysisTypeName |
( |
AnalysisType |
type | ) |
|
|
static |
Get human-readable name for analysis type.
◆ IsReady()
| bool ai::LogAnalyzer::IsReady |
( |
| ) |
const |
Check if AI service is ready.
◆ m_aiService
The documentation for this class was generated from the following files: