Open
Conversation
…dd RowNum identity column with composite index, and remove obsolete tblErrorlog rowset definition - Remove unused sqlLogin, sqlPassword, server, database, useWindowsAuth fields from ErrorLogImporter to avoid storing credentials unnecessarily in memory - Add RowNum bigint IDENTITY(1,1) column to tbl_ERRORLOG for deterministic row ordering - Add composite nonclustered index IX_tbl_ERRORLOG_LogDateTime_RowNum on (LogDateTime, RowNum) for efficient time-range queries - Remove obsolete tblErrorlog rowset definition from TextRowsets.xml (both copies) since ERRORLOG import is now handled by the dedicated ErrorLogImporter plugin
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…only to collection fields, remove dead variable - Replace string concatenation in loop (`pendingMessage += ...`) with `StringBuilder` to avoid O(n²) allocations on multi-line ERRORLOG entries - Mark `knownRowsets` and `options` fields as `readonly` since they are never reassigned - Remove unused `pendingMessage` variable, pass regex group value directly to `StringBuilder` constructor - Condense `pendingDateTime` assignment to ternary expression
…m/microsoft/SqlNexus into ErrorlogImporter_pijocoder_042726
… error extraction - Add nullable `ErrorNumber` (int) and `State` (int) columns to `tbl_ERRORLOG` - Add compiled regex to extract error number and state from messages matching `Error: NNNNN, Severity: NN, State: NN.` - Parse error/state client-side at insert time; columns remain NULL for non-error log entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Testing Plan
1. Build & Deploy Verification
ErrorLogImporter.dllis present insqlnexus\bin\Release\.2. Importer Discovery
Enabledchecked by default.3. Basic Import (SQLLogScout output)
SERVERNAME_ERRORLOGthroughSERVERNAME_ERRORLOG.6.tbl_ERRORLOGis created with all 7 columns (RowNum,LogDateTime,Process,Message,ErrorNumber,State,FileName).IX_tbl_ERRORLOG_LogDateTime_RowNumexists.SELECT FileName, COUNT(*) FROM tbl_ERRORLOG GROUP BY FileName— should return 7 rows).4. Multi-line / Continuation Lines
MessagecontainsCHAR(13)orCHAR(10)(e.g., registry startup parameters). Verify continuation lines are correctly appended to the parent entry rather than creating separate rows.5. Error and State Extraction
Query
Verify that rows with messages like
Error: 18456, Severity: 14, State: 38.have the correctErrorNumber(e.g.,18456) andState(e.g.,38) values populated.Verify that non-error rows have
NULLfor bothErrorNumberandState.Also query with this to see summary stats on errors
6. Re-import with "Drop existing tables" enabled
7. Disabled Importer
Enabledunder the ERRORLOG Importer options. Re-import. Verify ERRORLOG files do not appear in the file list andtbl_ERRORLOGis not created.