Skip to content

Commit

Permalink
Merge pull request #47 from aman-agrawal/OES-1.30.1
Browse files Browse the repository at this point in the history
Updated splunkLog filename & extension
  • Loading branch information
sanopsmx authored Jan 8, 2024
2 parents 611b84c + 8927ca4 commit d826679
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public ResponseEntity<byte[]> getSplunkLogs(@PathVariable("podName") String podN
String logUrl = baseURL.replace("CLUSTER_NAME", clusterName).replace("POD_NAME", podName);
log.info("Inside SplunkLogController - getSplunkLogs(), splunk Log URL : " + logUrl);

String logFileName = podName + "-log";
String headerValue = "attachment; filename=" + logFileName;
try (InputStream in = new URL(logUrl).openStream()) {
byte[] fileContents = in.readAllBytes();
return ResponseEntity.ok()
.header("Content-Disposition", "attachment; filename=log.zip")
.body(fileContents);
return ResponseEntity.ok().header("Content-Disposition", headerValue).body(fileContents);
}
}
}

0 comments on commit d826679

Please sign in to comment.