ELASTIC_CONFIG = {
"enabled": true,
"quiet": false,
"url": "elastic url",
"auth": "token for elastic url",
"common_index": "common-log", // used as fallback when index is not specified
"activity_index": "activity-log" // used for activity logs
}
ELASTIC_MANIFEST = {/* KUBE MANIFEST */}
// most customizable post action
elastic.post(
url: "your endpoint after elastic url + query",
body: {
"your_custom_structure": "any structure",
"field1": 1,
"field2": 2
},
index: "jaseci-elastic-log", // default to common_index
suffix: "empty or anything here" // default to empty
);
// similar to elastic.post but pointed to activity_index
elastic.post_act(url: str, body: dict, suffix: str = "");
// most customizable get action
elastic.get(
url: "your endpoint after elastic url + query",
body: {
"your_request_body_if_needed": "testing",
"any_ex_filter": [],
"any_ex_size": 10
},
index: "jaseci-elastic-log", // default to common_index
suffix: "empty or anything here" // default to empty
);
// similar to elastic.get but pointed to activity_index
elastic.get_act(url: str, body: dict, suffix: str = "");
// url is set to `/_doc` but log, query, index and sufix are still customizable
elastic.doc(
log: {
"your_custom_structure_if_needed": "any structure",
"field1": 1,
"field2": 2
},
query: "additional url query the elastic supports ex: filter_path=aggregations.**.key" // default to empty
index: "jaseci-elastic-log", // default to common_index
suffix: "empty or anything here" // default to empty
);
// similar to elastic.doc but pointed to activity_index
elastic.doc_activity(log: dict, query: str = "", suffix: str = "");
// url is set to `/_search` but body, query, index and sufix are still customizable
elastic.search(
body: {
"your_request_body_if_needed": "testing",
"any_ex_filter": [],
"any_ex_size": 10
},
query: "additional url query the elastic supports ex: filter_path=aggregations.**.key" // default to empty
index: "jaseci-elastic-log", // default to common_index
suffix: "empty or anything here" // default to empty
);
// similar to elastic.search but pointed to activity_index
elastic.search_activity(body: dict, query: str = "", suffix: str = "");
// url is set to `/_mapping` but query, index and sufix are still customizable
elastic.mapping(
query: "additional url query the elastic supports ex: filter_path=aggregations.**.key" // default to empty
index: "jaseci-elastic-log", // default to common_index
suffix: "empty or anything here" // default to empty
);
// similar to elastic.mapping but pointed to activity_index
elastic.mapping_activity(query: str = "", suffix: str = "");
// url is set to `/_aliases` but query is still customizable
elastic.aliases(query: str = "pretty=true");
// url is set to `/_reindex` but body, query is still customizable
elastic.reindex(
body: {
"source": {
"index": "act-zsbdev",
"size": 10
},
"dest": {
"index": "actlog-zsbdev"
}
},
query: "additional url query the elastic supports ex: filter_path=aggregations.**.key" // default to empty
)