Skip to content

Commit fe9ac67

Browse files
committed
set the dt query to use non case sensitive
1 parent 56aee42 commit fe9ac67

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/dynatrace/dtquery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (q *DTQuery) Status(statusList []string) *DTQuery {
130130
}
131131

132132
func (q *DTQuery) ContainsPhrase(phrase string) *DTQuery {
133-
q.fragments = append(q.fragments, " and contains(content,\""+phrase+"\")")
133+
q.fragments = append(q.fragments, " and contains(content,\""+phrase+"\", caseSensitive:false)")
134134

135135
return q
136136
}

cmd/dynatrace/dtquery_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestDTQuery_Namespaces(t *testing.T) {
5353

5454
func TestDTQuery_ContainsPhrase(t *testing.T) {
5555
q := new(DTQuery).InitLogs(1).ContainsPhrase("error")
56-
expected := ` and contains(content,"error")`
56+
expected := ` and contains(content,"error", caseSensitive:false)`
5757
if q.fragments[1] != expected {
5858
t.Errorf("expected: %s\ngot: %s", expected, q.fragments[1])
5959
}
@@ -105,7 +105,7 @@ func TestDTQuery_Build(t *testing.T) {
105105
Limit(5)
106106

107107
expected := `fetch logs, from:now()-1h
108-
| filter matchesValue(event.type, "LOG") and matchesPhrase(dt.kubernetes.cluster.name, "prod-cluster") and (matchesValue(k8s.namespace.name, "ns1")) and contains(content,"fail")` +
108+
| filter matchesValue(event.type, "LOG") and matchesPhrase(dt.kubernetes.cluster.name, "prod-cluster") and (matchesValue(k8s.namespace.name, "ns1")) and contains(content,"fail", caseSensitive:false)` +
109109
"\n| limit 5"
110110

111111
actual := q.Build()

0 commit comments

Comments
 (0)