protected override ParsingResult ParseSource(ILogSource source, LogReaderSettings settings, ParsingResult result = null) { if (source == null) { throw new ArgumentNullException(nameof(source)); } TextStorage storage = new TextStorage(); result = result ?? new ParsingResult(); var log = (IEnumerable <string[]>)source; if (!(source is AzureLogSource)) { throw new ApplicationException("Non Azure log source was tried to be parsed by Azure log reader"); } foreach (var lines in log) { var logEntry = logParser.ParseLine(lines[0], new DateTime(long.Parse(lines[1])), storage); if (logEntry != null) { logEntry = AnalyzeLog(logEntry, storage); result.AddToGroupAll(logEntry); } } return(result); }
private ParsingResult FilterLogs(ParsingResult parsingResultWithoutFiltering, LogReaderSettings settings) { ParsingResult parsingResult = new ParsingResult(); foreach (var entry in parsingResultWithoutFiltering.All) { bool matchesFilter = false; ApplyFilter(entry.LogDateTime, settings, entry.ToString(), ref matchesFilter, false); if (matchesFilter) parsingResult.AddToGroupAll(entry); } return parsingResult; }
private ParsingResult FilterLogs(ParsingResult parsingResultWithoutFiltering, LogReaderSettings settings) { ParsingResult parsingResult = new ParsingResult(); foreach (var entry in parsingResultWithoutFiltering.All) { bool matchesFilter = false; ApplyFilter(entry.LogDateTime, settings, entry.ToString(), ref matchesFilter, false); if (matchesFilter) { parsingResult.AddToGroupAll(entry); } } return(parsingResult); }
protected override ParsingResult ParseSource(ILogSource source, LogReaderSettings settings, ParsingResult result = null) { if (source == null) throw new ArgumentNullException(nameof(source)); TextStorage storage = new TextStorage(); result = result ?? new ParsingResult(); var log = (IEnumerable<string[]>)source; if (!(source is AzureLogSource)) throw new ApplicationException("Non Azure log source was tried to be parsed by Azure log reader"); foreach (var lines in log) { var logEntry = logParser.ParseLine(lines[0], new DateTime(long.Parse(lines[1])), storage); if (logEntry != null) { logEntry = AnalyzeLog(logEntry, storage); result.AddToGroupAll(logEntry); } } return result; }