Skip to content

Commit

Permalink
Edited commits field to be array instead of object to avoid 'Too many…
Browse files Browse the repository at this point in the history
… fields present in the index' issue
  • Loading branch information
adnanrahic committed Apr 16, 2020
1 parent 0ef9444 commit 01500b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/logagent.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ LaCli.prototype.loadPlugins = function (configFile) {
{ module: '../lib/plugins/input/stdin', config: stdInConfig, globalConfig: configFile },
{ module: '../lib/plugins/output/stdout', config: stdOutConfig, globalConfig: configFile }
]
if (this.argv.k8sEvents) {
plugins.push({
module: 'input-kubernetes-events',
Expand Down
17 changes: 9 additions & 8 deletions lib/plugins/output-filter/github-logs-format.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
function formatSematextLogsOutput (context, config, eventEmitter, log, callback) {
try {
const parsedLog = parseGithubEvent(log)

if (config.debug) {
console.log(parsedLog)
}

if (parsedLog) { callback(null, parsedLog) }
} catch (e) {
callback(e, log)
Expand Down Expand Up @@ -314,14 +319,9 @@ const parsePush = (event, body) => {
modified
}

acc[id] = currCommit
acc.push(currCommit)
return acc
}, {})

const parsedCommits = {
count: commitCount,
...reducedCommits
}
}, [])

return {
...initEvent({ event, action, webhookName: 'GitHub' }),
Expand All @@ -332,7 +332,8 @@ const parsePush = (event, body) => {
repository: parsedRepo,
sender: parsedSender,
headCommit: parsedHeadCommit,
commits: parsedCommits
commitCount,
commits: reducedCommits
}
}

Expand Down

0 comments on commit 01500b8

Please sign in to comment.