Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
d5a1f6ad
Commit
d5a1f6ad
authored
1 year ago
by
Johan de Klerk
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of gitlab.bob.co.za:bob-public-utils/bobgroup-go-utils
parents
dbce8d60
45e6ab58
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api_logs/api-logs.go
+4
-4
4 additions, 4 deletions
api_logs/api-logs.go
opensearch/time_series.go
+9
-0
9 additions, 0 deletions
opensearch/time_series.go
with
13 additions
and
4 deletions
api_logs/api-logs.go
+
4
−
4
View file @
d5a1f6ad
...
...
@@ -194,14 +194,14 @@ type ApiLog struct {
}
type
ApiLogRequest
struct
{
Headers
map
[
string
]
string
`json:"headers,omitempty"`
Headers
map
[
string
]
string
`json:"headers,omitempty"`
// NOTE: Once we're on OpenSearch 2.7, we should add search:"flattened" here
QueryParameters
map
[
string
]
string
`json:"query_parameters,omitempty"`
BodySize
int
`json:"body_size" search:"long"`
// set even when body is truncated/omitted
Body
string
`json:"body,omitempty"`
// json body as a string
}
type
ApiLogResponse
struct
{
Headers
map
[
string
]
string
`json:"headers,omitempty"`
Headers
map
[
string
]
string
`json:"headers,omitempty"`
// NOTE: Once we're on OpenSearch 2.7, we should add search:"flattened" here
BodySize
int
`json:"body_size"`
// set even when body is truncated/omitted
Body
string
`json:"body,omitempty"`
// json content as a string
}
This diff is collapsed.
Click to expand it.
opensearch/time_series.go
+
9
−
0
View file @
d5a1f6ad
...
...
@@ -170,6 +170,12 @@ func structMappingProperties(structType reflect.Type) (map[string]MappingPropert
fieldMapping
=
MappingProperty
{
Properties
:
subStructProperties
,
}
}
else
if
structField
.
Type
.
Kind
()
==
reflect
.
Map
{
// For maps, we only want to map if we specified "flattened" in the search tag
// If we did not specify the tag, we want to just continue without mapping
if
structField
.
Tag
.
Get
(
"search"
)
!=
"flattened"
{
continue
}
}
else
{
// fieldMapping = MappingProperty{Type: "text"}
// unknown value type... we do not specify mapping and let it use dynamic mapping
...
...
@@ -194,6 +200,9 @@ func structMappingProperties(structType reflect.Type) (map[string]MappingPropert
case
"object"
:
fieldMapping
.
Type
=
"object"
fieldMapping
.
Enabled
=
false
case
"flattened"
:
// NOTE: This is only supported from OpenSearch 2.7 and onwards
fieldMapping
.
Type
=
"flat_object"
case
"-"
:
// do not include in mapping
skip
=
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment