diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2020-03-07 16:55:49 +0000 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2020-03-07 16:55:49 +0000 |
| commit | fef20a8473a55858b6e753d420ec9232dbcb7671 (patch) | |
| tree | 9a95ec19c04b087e84e9db37f4bc9b2b7f7a1d49 /internal/mapr/logformat/generic.go | |
| parent | 427e5c14454804c28bd6fa2205bb4121f52c1fbd (diff) | |
add support to run mapreduce queries on generic log lines, e.g. count all log lines containing a certain string, such as "ERROR"
Diffstat (limited to 'internal/mapr/logformat/generic.go')
| -rw-r--r-- | internal/mapr/logformat/generic.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/mapr/logformat/generic.go b/internal/mapr/logformat/generic.go new file mode 100644 index 0000000..9102c0b --- /dev/null +++ b/internal/mapr/logformat/generic.go @@ -0,0 +1,13 @@ +package logformat + +// MakeFieldsGENEROC is the generic log line parser. +func (p *Parser) MakeFieldsGENERIC(maprLine string) (map[string]string, error) { + fields := make(map[string]string, 3) + + fields["*"] = "*" + fields["$hostname"] = p.hostname + fields["$line"] = maprLine + fields["$empty"] = "" + + return fields, nil +} |
