aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/admin/vespa-wrapper/logfmt/internal.go
blob: 992c537f939e9d53a359c2eac3124e0d3e7ea791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// vespa logfmt command
// Author: arnej

package logfmt

import (
	"strings"
)

// is componentName a vespa-internal name?

func isInternal(componentName string) bool {
	cs := strings.Split(componentName, ".")
	if len(cs) == 0 || cs[0] != "Container" {
		return true
	}
	if len(cs) < 3 {
		return false
	}
	if cs[1] == "ai" && cs[2] == "vespa" {
		return true
	}
	if cs[1] == "com" && cs[2] == "yahoo" && len(cs) > 3 {
		return internalComYahooNames[cs[3]]
	}
	return false
}

// a constant:
var internalComYahooNames = map[string]bool{
	"abicheck":              true,
	"api":                   true,
	"application":           true,
	"binaryprefix":          true,
	"clientmetrics":         true,
	"cloud":                 true,
	"collections":           true,
	"component":             true,
	"compress":              true,
	"concurrent":            true,
	"configtest":            true,
	"config":                true,
	"container":             true,
	"data":                  true,
	"docprocs":              true,
	"docproc":               true,
	"documentapi":           true,
	"documentmodel":         true,
	"document":              true,
	"dummyreceiver":         true,
	"embedding":             true,
	"errorhandling":         true,
	"exception":             true,
	"feedapi":               true,
	"feedhandler":           true,
	"filedistribution":      true,
	"fs4":                   true,
	"fsa":                   true,
	"geo":                   true,
	"io":                    true,
	"javacc":                true,
	"jdisc":                 true,
	"jrt":                   true,
	"lang":                  true,
	"language":              true,
	"logserver":             true,
	"log":                   true,
	"messagebus":            true,
	"metrics":               true,
	"nativec":               true,
	"net":                   true,
	"osgi":                  true,
	"path":                  true,
	"plugin":                true,
	"prelude":               true,
	"processing":            true,
	"protect":               true,
	"reflection":            true,
	"restapi":               true,
	"schema":                true,
	"searchdefinition":      true,
	"searchlib":             true,
	"search":                true,
	"security":              true,
	"slime":                 true,
	"socket":                true,
	"statistics":            true,
	"stream":                true,
	"system":                true,
	"tensor":                true,
	"test":                  true,
	"text":                  true,
	"time":                  true,
	"transaction":           true,
	"vdslib":                true,
	"vespaclient":           true,
	"vespafeeder":           true,
	"vespaget":              true,
	"vespastat":             true,
	"vespasummarybenchmark": true,
	"vespa":                 true,
	"vespavisit":            true,
	"vespaxmlparser":        true,
	"yolean":                true,
}