code: private String extractExecTailCmd(String params) {
          String ret;
          String[] tmp = params.split("(?<!\\\\)" + separator);
          String labelString = null;
          for (String aTmp : tmp) {
              if (aTmp.startsWith("label=")) {
                  labelString = aTmp;
              }
          }
  
          if (labelString != null) {
              if (params.startsWith(labelString)) {
                  ret = params.substring(labelString.length() + separator.length());
              } else {
                  ret = params.substring(0, params.indexOf(labelString) - separator.length());
              }
          } else {
              ret = params;
          }
  
          return ret;
      }
docs: extract exec or tail command (handle label)