...
The code below needs to be put into the 'Script' part of the above page.
The drill-down time range is pre-set by -60 seconds to +5 seconds; the user could change the values as necessary.
- The IP address in the URL of the code should be modified for the user's ONAP kibana server.
- The dashboard ID (105a83d0- ... in Id (in this case, "cl_Culprit_Locator_Subcomponent_Level" in the code) should match with the one for the imported dashboard "Culprit Locator (Subcomponent Level)". . Import Kibana objects is the nex step. If it does not match, the user needs to fix the script code.
Code Block |
---|
if (doc['loglevel.keyword'].value == "ERROR") { DateTimeFormatter ft = DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss.SSS"); Instant from_instant = Instant.ofEpochMilli(doc['Timestamp'].value - 60000); Instant to_instant = Instant.ofEpochMilli(doc['Timestamp'].value + 5000); ZonedDateTime from_z = from_instant.atZone(ZoneId.of("UTC")); ZonedDateTime to_z = to_instant.atZone(ZoneId.of("UTC")); String from_ts = from_z.format(ft); String to_ts = to_z.format(ft); String ReqId = doc['RequestId.keyword'].value; String URL = "http://10.147.58.138:5601/app/kibana#/dashboard/105a83d0-215e-11e8-a744-95cec6f8f1a4cl_Culprit_Locator_Subcomponent_Level?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:'" + from_ts + "',mode:absolute,to:'" + to_ts + "'))&_a=(description:'',filters:!(),options:(darkTheme:!f),query:(query_string:(analyze_wildcard:!t,query:'RequestId:%20%22" + ReqId + "%22')),timeRestore:!f,viewMode:view)"; return URL; } |
Import Kibana Objects
Two approaches are provided for importing Take one of two approaches below to import the Kibana objects (dashboards/visualizations/searches).
- Download the Kibana object json file into the file Culprit Locator Kibana Objects into the user's computer, and import it on Kibana: Management→Saved Objects → Import.
...
- Download and uncompress the tar file into the home any directory of the onap-log kibana server. Run the script, "#python3 onap_import_kibana_objects.py"elasticsearch server.
How To Use
This explains the basic features of current version of Culprit Locator. The users are encouraged to take advantage of the full flexibility of Kibana features to modify and enhance the dashboards to their puporses and preferences.
...