File tree Expand file tree Collapse file tree
transformation_test/testdata/logging_processor-iis_access Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,15 @@ func (p LoggingProcessorMacroIisAccess) Expand(ctx context.Context) []confgenera
290290 // Handle field concatenation (serverIp+port, requestUrl)
291291 concatFields := IISConcatFields {}
292292
293+ // This is used to exclude the header lines above the logs
294+ // EXAMPLE LINES:
295+ // #Software: Microsoft Internet Information Services 10.0
296+ // #Version: 1.0
297+ // #Date: 2022-04-11 12:53:50
298+ excludeLogs := confgenerator.LoggingProcessorExcludeLogs {
299+ MatchAny : []string {`jsonPayload.message=~"^#(?:Fields|Date|Version|Software):"` },
300+ }
301+
293302 // Create fields map for simple field operations and moves
294303 fields := map [string ]* confgenerator.ModifyField {
295304 InstrumentationSourceLabel : instrumentationSourceValue (p .Type ()),
@@ -317,6 +326,7 @@ func (p LoggingProcessorMacroIisAccess) Expand(ctx context.Context) []confgenera
317326 return []confgenerator.InternalLoggingProcessor {
318327 parseRegex ,
319328 concatFields ,
329+ excludeLogs ,
320330 modifyFields ,
321331 }
322332}
Original file line number Diff line number Diff line change 1+ #Software: Microsoft Internet Information Services 10.0
2+ #Version: 1.0
3+ #Date: 2022-04-11 12:53:50
142022-03-10 17:26:30 ::1 GET /iisstart.png - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko http://localhost/ 200 0 0 18
252022-03-10 17:26:30 ::1 GET / - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 200 0 0 352
362022-03-10 17:26:32 ::1 GET /favicon.ico - 80 - ::1 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 404 0 2 49
You can’t perform that action at this time.
0 commit comments