-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99957ab
commit 8c28ae5
Showing
184 changed files
with
3,000 additions
and
2,811 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
49 changes: 49 additions & 0 deletions
49
.../testdata/valid/linux/logging-receiver_apache/golden_5fc5f42c16c9e1ab8292e3d42f74f3be.lua
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
function shallow_merge(record, parsedRecord) | ||
-- If no exiting record exists | ||
if (record == nil) then | ||
return parsedRecord | ||
end | ||
|
||
for k, v in pairs(parsedRecord) do | ||
record[k] = v | ||
end | ||
|
||
return record | ||
end | ||
|
||
function merge(record, parsedRecord) | ||
-- If no exiting record exists | ||
if record == nil then | ||
return parsedRecord | ||
end | ||
|
||
-- Potentially overwrite or merge the original records. | ||
for k, v in pairs(parsedRecord) do | ||
-- If there is no conflict | ||
if k == "logging.googleapis.com/logName" then | ||
-- Ignore the parsed payload since the logName is controlled | ||
-- by the OpsAgent. | ||
elseif k == "logging.googleapis.com/labels" then | ||
-- LogEntry.labels are basically a map[string]string and so only require a | ||
-- shallow merge (one level deep merge). | ||
record[k] = shallow_merge(record[k], v) | ||
else | ||
record[k] = v | ||
end | ||
end | ||
|
||
return record | ||
end | ||
|
||
function parser_merge_record(tag, timestamp, record) | ||
originalPayload = record["logging.googleapis.com/__tmp"] | ||
if originalPayload == nil then | ||
return 0, timestamp, record | ||
end | ||
|
||
-- Remove original payload | ||
record["logging.googleapis.com/__tmp"] = nil | ||
record = merge(originalPayload, record) | ||
return 2, timestamp, record | ||
end |
46 changes: 0 additions & 46 deletions
46
.../testdata/valid/linux/logging-receiver_apache/golden_d3ec85a195ff5cdac07365a78338e96f.lua
This file was deleted.
Oops, something went wrong.
This file contains 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
49 changes: 49 additions & 0 deletions
49
...ta/valid/linux/logging-receiver_apache_custom/golden_5fc5f42c16c9e1ab8292e3d42f74f3be.lua
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
function shallow_merge(record, parsedRecord) | ||
-- If no exiting record exists | ||
if (record == nil) then | ||
return parsedRecord | ||
end | ||
|
||
for k, v in pairs(parsedRecord) do | ||
record[k] = v | ||
end | ||
|
||
return record | ||
end | ||
|
||
function merge(record, parsedRecord) | ||
-- If no exiting record exists | ||
if record == nil then | ||
return parsedRecord | ||
end | ||
|
||
-- Potentially overwrite or merge the original records. | ||
for k, v in pairs(parsedRecord) do | ||
-- If there is no conflict | ||
if k == "logging.googleapis.com/logName" then | ||
-- Ignore the parsed payload since the logName is controlled | ||
-- by the OpsAgent. | ||
elseif k == "logging.googleapis.com/labels" then | ||
-- LogEntry.labels are basically a map[string]string and so only require a | ||
-- shallow merge (one level deep merge). | ||
record[k] = shallow_merge(record[k], v) | ||
else | ||
record[k] = v | ||
end | ||
end | ||
|
||
return record | ||
end | ||
|
||
function parser_merge_record(tag, timestamp, record) | ||
originalPayload = record["logging.googleapis.com/__tmp"] | ||
if originalPayload == nil then | ||
return 0, timestamp, record | ||
end | ||
|
||
-- Remove original payload | ||
record["logging.googleapis.com/__tmp"] = nil | ||
record = merge(originalPayload, record) | ||
return 2, timestamp, record | ||
end |
46 changes: 0 additions & 46 deletions
46
...ta/valid/linux/logging-receiver_apache_custom/golden_d3ec85a195ff5cdac07365a78338e96f.lua
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.