You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/18 07:12:24 UTC

[GitHub] [inlong] GanfengTan opened a new pull request, #5590: [INLONG-5589][Agent] To extend type of file data for k8s log

GanfengTan opened a new pull request, #5590:
URL: https://github.com/apache/inlong/pull/5590

   Support k8s log:
   1. standard k8s log
   2. ordinary k8s log
   
   - Fixes #5589 
   
   ### Motivation
   
   1. To judge json 
   2. To connect data and metadata
   
   ### Modifications
   
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [x] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow merged pull request #5590: [INLONG-5589][Agent] To extend type of file data for k8s log

Posted by GitBox <gi...@apache.org>.
healchow merged PR #5590:
URL: https://github.com/apache/inlong/pull/5590


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] EMsnap commented on a diff in pull request #5590: [INLONG-5589][Agent] To extend type of file data for k8s log

Posted by GitBox <gi...@apache.org>.
EMsnap commented on code in PR #5590:
URL: https://github.com/apache/inlong/pull/5590#discussion_r949839979


##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/FileDataUtils.java:
##########
@@ -37,14 +38,31 @@ public class FileDataUtils {
     /**
      * Get standard log for k8s
      */
-    public static String getK8sJsonLog(String log) {
+    public static String getK8sJsonLog(String log, Boolean isJson) {
         if (!StringUtils.isNoneBlank(log)) {
             return null;
         }
+        if (!isJson) {
+            return log;
+        }
         Type type = new TypeToken<HashMap<Integer, String>>() {
         }.getType();
         Map<String, String> logJson = GSON.fromJson(log, type);
-        return logJson.get(KUBERNETES_LOG);
+        return logJson.getOrDefault(KUBERNETES_LOG, log);
     }
 
+    /**
+     * To judge json
+     */
+    public static boolean isJSON(String json) {
+        boolean flag;

Review Comment:
   flag is vague as a variable name



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org