Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
eagleEye
/
flume-interceptor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ae515a5
authored
Aug 20, 2025
by
魏建枢
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加日志拦截flume
parent
2ac35d18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
flume-interceptor/src/main/java/com/org/apache/flume/interceptor/interceptor/InterceptorDataFormatUtil.java
flume-interceptor/src/main/java/com/org/apache/flume/interceptor/interceptor/InterceptorSelector.java
flume-interceptor/src/main/java/com/org/apache/flume/interceptor/interceptor/InterceptorDataFormatUtil.java
View file @
9ae515a5
package
com
.
org
.
apache
.
flume
.
interceptor
.
interceptor
;
package
com
.
org
.
apache
.
flume
.
interceptor
.
interceptor
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cloud.common.aop.enums.LoggingType
;
import
com.cloud.common.aop.enums.RequestModel
;
import
com.cloud.common.aop.tools.ServletUtil
;
/**
/**
* @author wjs
* @author wjs
...
@@ -311,4 +315,28 @@ public class InterceptorDataFormatUtil {
...
@@ -311,4 +315,28 @@ public class InterceptorDataFormatUtil {
return
arrayList
;
return
arrayList
;
}
}
public
static
List
<
String
>
sysLogDataFormat
(
JSONObject
jsonObj
)
{
List
<
String
>
arrayList
=
new
ArrayList
<>();
arrayList
.
add
(
jsonObj
.
getString
(
"id"
));
arrayList
.
add
(
jsonObj
.
getString
(
"title"
));
arrayList
.
add
(
jsonObj
.
getString
(
"method"
));
arrayList
.
add
(
jsonObj
.
getString
(
"operation_log_type"
));
arrayList
.
add
(
jsonObj
.
getString
(
"request_method"
));
arrayList
.
add
(
jsonObj
.
getString
(
"description"
));
arrayList
.
add
(
jsonObj
.
getString
(
"operate_url"
));
arrayList
.
add
(
jsonObj
.
getString
(
"operate_address"
));
arrayList
.
add
(
jsonObj
.
getString
(
"request_param"
));
arrayList
.
add
(
jsonObj
.
getString
(
"request_body"
));
arrayList
.
add
(
jsonObj
.
getString
(
"response_body"
));
arrayList
.
add
(
jsonObj
.
getString
(
"success"
));
arrayList
.
add
(
jsonObj
.
getString
(
"logging_type"
));
arrayList
.
add
(
jsonObj
.
getString
(
"error_msg"
));
arrayList
.
add
(
jsonObj
.
getString
(
"browser"
));
arrayList
.
add
(
jsonObj
.
getString
(
"system_os"
));
arrayList
.
add
(
jsonObj
.
getString
(
"create_time"
));
arrayList
.
add
(
jsonObj
.
getString
(
"operate_name"
));
arrayList
.
add
(
jsonObj
.
getString
(
"request_headers"
));
return
arrayList
;
}
}
}
flume-interceptor/src/main/java/com/org/apache/flume/interceptor/interceptor/InterceptorSelector.java
View file @
9ae515a5
...
@@ -59,6 +59,8 @@ public class InterceptorSelector {
...
@@ -59,6 +59,8 @@ public class InterceptorSelector {
return
dataSplit
(
InterceptorDataFormatUtil
.
pcCollectLogDataFormat
(
jsonObj
));
return
dataSplit
(
InterceptorDataFormatUtil
.
pcCollectLogDataFormat
(
jsonObj
));
}
else
if
(
StringUtils
.
equals
(
flume_type
,
"pcEventLog"
))
{
}
else
if
(
StringUtils
.
equals
(
flume_type
,
"pcEventLog"
))
{
return
dataSplit
(
InterceptorDataFormatUtil
.
pcEventLogDataFormat
(
jsonObj
));
return
dataSplit
(
InterceptorDataFormatUtil
.
pcEventLogDataFormat
(
jsonObj
));
}
else
if
(
StringUtils
.
equals
(
flume_type
,
"sysLog"
))
{
return
dataSplit
(
InterceptorDataFormatUtil
.
sysLogDataFormat
(
jsonObj
));
}
}
return
resultStr
;
return
resultStr
;
}
}
...
...
Write
Preview
Markdown
is supported
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