File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
java/io/dongtai/iast/agent Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ private String getDebugFlag() {
220220
221221 public String getLogPort () {
222222 if (logPort == null ) {
223- logPort = System .getProperty ("dongtai.log.port" , "30909" );
223+ logPort = System .getProperty ("dongtai.log.port" );
224224 }
225225 return logPort ;
226226 }
Original file line number Diff line number Diff line change @@ -68,7 +68,19 @@ public static void confReplace(String path) {
6868 temp = temp .replace ("${OPENAPI}" , logAddress );
6969 }
7070 }else if (temp .contains ("${LOG_PORT}" )){
71- temp = temp .replace ("${LOG_PORT}" ,IastProperties .getInstance ().getLogPort ());
71+ String logPort = IastProperties .getInstance ().getLogPort ();
72+ if (null == logPort ){
73+ String s = IastProperties .getInstance ().getBaseUrl ();
74+ s = s .substring (s .indexOf ("://" ) + 3 , s .indexOf ("/openapi" ));
75+ if (s .contains (":" )){
76+ s = s .substring (s .indexOf (":" )+1 );
77+ temp = temp .replace ("${LOG_PORT}" , s );
78+ }else {
79+ temp = temp .replace ("${LOG_PORT}" , "80" );
80+ }
81+ }else {
82+ temp = temp .replace ("${LOG_PORT}" , logPort );
83+ }
7284 }else if (temp .contains ("${LOG_PATH}" )){
7385 temp = temp .replace ("${LOG_PATH}" , System .getProperty ("java.io.tmpdir.dongtai" )+File .separator +"dongtaiJavaAgentLogs" +File .separator +"dongtai_javaagent.log" );
7486 }
Original file line number Diff line number Diff line change 11[SERVICE]
22 Flush 5
33 Daemon OFF
4- Log_Level info
4+ Log_Level error
55 HTTP_Server Off
66[INPUT]
77 Name tail
1818 Record hostname ${HOSTNAME}
1919 Record agent ${AGENT_ID}
2020[OUTPUT]
21- Name tcp
21+ Name http
2222 Match *
2323 Host ${OPENAPI}
2424 Port ${LOG_PORT}
25+ URI /log/
26+ HTTP_User sjkadfkjdsahfkds
27+ HTTP_Passwd dsjkfkjsadfhkjsadhfksdsjdafjkdsagfjhsadgfjsdfg12312!
2528 Format json_lines
You can’t perform that action at this time.
0 commit comments