26
26
* @source_2: https://github.com/zumo64/ELK_POC
27
27
*/
28
28
public class ElasticsearchBackend extends AbstractBackendListenerClient {
29
- private static final String ES_PROTOCOL = "es.protocol" ;
30
29
private static final String ES_HOST = "es.host" ;
31
30
private static final String ES_PORT = "es.transport.port" ;
32
31
private static final String ES_INDEX = "es.index" ;
33
- private static final String ES_INDEX_TYPE = "es.indexType" ;
34
32
private static final String ES_TIMESTAMP = "es.timestamp" ;
35
33
private static final String ES_STATUS_CODE = "es.status.code" ;
36
34
private static final String ES_CLUSTER = "es.cluster" ;
@@ -39,7 +37,6 @@ public class ElasticsearchBackend extends AbstractBackendListenerClient {
39
37
private Client client ;
40
38
private Settings settings ;
41
39
private String index ;
42
- private String indexType ;
43
40
private String host ;
44
41
private int port ;
45
42
private int buildNumber ;
@@ -49,11 +46,9 @@ public class ElasticsearchBackend extends AbstractBackendListenerClient {
49
46
@ Override
50
47
public Arguments getDefaultParameters () {
51
48
Arguments parameters = new Arguments ();
52
- parameters .addArgument (ES_PROTOCOL , "https" );
53
49
parameters .addArgument (ES_HOST , null );
54
50
parameters .addArgument (ES_PORT , "9300" );
55
51
parameters .addArgument (ES_INDEX , null );
56
- parameters .addArgument (ES_INDEX_TYPE , "SampleResult" );
57
52
parameters .addArgument (ES_TIMESTAMP , "yyyy-MM-dd'T'HH:mm:ss.SSSZZ" );
58
53
parameters .addArgument (ES_STATUS_CODE , "531" );
59
54
parameters .addArgument (ES_CLUSTER , "elasticsearch" );
@@ -65,7 +60,6 @@ public Arguments getDefaultParameters() {
65
60
public void setupTest (BackendListenerContext context ) throws Exception {
66
61
try {
67
62
this .index = context .getParameter (ES_INDEX );
68
- this .indexType = context .getParameter (ES_INDEX_TYPE );
69
63
this .host = context .getParameter (ES_HOST );
70
64
this .bulkSize = Integer .parseInt (context .getParameter (ES_BULK_SIZE ));
71
65
this .port = Integer .parseInt (context .getParameter (ES_PORT ));
@@ -82,7 +76,7 @@ public void setupTest(BackendListenerContext context) throws Exception {
82
76
@ Override
83
77
public void handleSampleResults (List <SampleResult > results , BackendListenerContext context ) {
84
78
for (SampleResult sr : results ) {
85
- this .bulkRequest .add (this .client .prepareIndex (this .index , this . indexType ).setSource (this .getElasticData (sr , context ), XContentType .JSON ));
79
+ this .bulkRequest .add (this .client .prepareIndex (this .index , "SampleResult" ).setSource (this .getElasticData (sr , context ), XContentType .JSON ));
86
80
}
87
81
88
82
if (this .bulkRequest .numberOfActions () >= this .bulkSize ) {
0 commit comments