Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Loggie
Commits
0eb278ea
Unverified
Commit
0eb278ea
authored
2 years ago
by
listencx
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: if obj.GetPath not found use obj.Get (#297)
parent
f720d8c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/interceptor/normalize/rename.go
+12
-6
pkg/interceptor/normalize/rename.go
with
12 additions
and
6 deletions
+12
-6
pkg/interceptor/normalize/rename.go
+
12
-
6
View file @
0eb278ea
...
...
@@ -77,14 +77,20 @@ func (r *MoveProcessor) Process(e api.Event) error {
e
.
Fill
(
e
.
Meta
(),
e
.
Header
(),
[]
byte
{})
continue
}
v
al
:=
obj
.
GetPath
(
from
)
if
v
al
.
IsNull
()
{
log
.
Info
(
"move fields from %s is not exist"
,
from
)
log
.
Debug
(
"move event: %s"
,
e
.
String
())
pathV
al
:=
obj
.
GetPath
(
from
)
if
!
pathV
al
.
IsNull
()
{
obj
.
DelPath
(
from
)
obj
.
SetPath
(
convert
.
To
,
pathVal
.
Value
())
continue
}
obj
.
DelPath
(
from
)
obj
.
SetPath
(
convert
.
To
,
val
.
Value
())
val
:=
obj
.
Get
(
from
)
if
!
val
.
IsNull
()
{
obj
.
Del
(
from
)
obj
.
Set
(
convert
.
To
,
val
.
Value
())
continue
}
log
.
Info
(
"move fields from %s is not exist"
,
from
)
log
.
Debug
(
"move event: %s"
,
e
.
String
())
}
return
nil
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment