code: private int retrieveIndexValueFromFileName(String fileName) {
          int index = 0;
          if (fileName != null && !fileName.trim().isEmpty()) {
              index = Integer.parseInt(fileName.substring(fileName.lastIndexOf('-') + 1,
                      fileName.length() - EXTENSION.length()));
          }
          return index;
      }
docs: This method return index of the file name (example selion-grid-1.log)
  
  @param fileName
  log file name
  @return an index value of the file