-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logstash diagnostics added, human added to all pretty parameters, _te…
…mplate added, cat_fielddata changed to .txt extension
- Loading branch information
Showing
10 changed files
with
146 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/elastic/support/diagnostics/commands/RunLogstashQueriesCmd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.elastic.support.diagnostics.commands; | ||
|
||
import com.elastic.support.SystemProperties; | ||
import com.elastic.support.diagnostics.DiagnosticContext; | ||
import com.elastic.support.diagnostics.InputParams; | ||
import com.elastic.support.diagnostics.RestModule; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class RunLogstashQueriesCmd extends AbstractDiagnosticCmd { | ||
|
||
public boolean execute(DiagnosticContext context) { | ||
|
||
InputParams inputs = context.getInputParams(); | ||
Map config = context.getConfig(); | ||
RestModule restModule = context.getRestModule(); | ||
String queryName; | ||
String fileName; | ||
|
||
Map<String, String> statements = (Map<String, String>) config.get("logstash"); | ||
Set<Map.Entry<String, String>> entries = statements.entrySet(); | ||
|
||
logger.debug("Generating full diagnostic."); | ||
|
||
for (Map.Entry<String, String> entry : entries) { | ||
queryName = entry.getKey(); | ||
String query = entry.getValue(); | ||
logger.debug(": now processing " + queryName + ", " + query); | ||
String url = inputs.getUrl() + "/" + query; | ||
logger.info("Currently running the following query:" + queryName); | ||
|
||
String ext = ".json"; | ||
|
||
fileName = context.getTempDir() + SystemProperties.fileSeparator + queryName + ext; | ||
restModule.submitRequest(url, queryName, fileName); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.