Change x-axis label

116 views
Skip to first unread message

longbkap...@gmail.com

unread,
Apr 9, 2018, 11:22:17 AM4/9/18
to Wazuh mailing list

I try change label y-axis and x-asix:

For y-axis, I can change. I edit file: /usr/share/kibana/plugins/wazuh/server/integration-files/app-objects-file-alerts.json. It's OK. The label "Count" is changed to "Numbers alerts".
But for x-axis, I can not change label "@timestamp per 3 hours" to "Time:3 hours".
Please help me to do that.
And more, please show me in which file I can change label of tooltip.
Thanks

jesus.g...@wazuh.com

unread,
Apr 9, 2018, 11:43:58 AM4/9/18
to Wazuh mailing list
Hi @longbkaptech2016,

since you are editing a backend file, I suggest you to avoid do that. Instead you could edit your visualizations
through the Kibana UI on the right (an easier) way. To do this please open the Kibana UI and click on Visualize,
once done please follow the next steps:

1. Search the visualization with the name Wazuh App Overview General Agents status



2. Click on X-Axis and edit the label field:



3. Click on Y-Axis and edit the label field:




4. Click "Save" on the top bar, and please ensure you have un-checked "Save as new visualization", this way you will override your current visualization!



Hope it helps, have a nice day.

Note 1: if another user is viewing the Wazuh App, you will affect that user.
Note 2: if you delete the .kibana index, you will lose these changes.

Best regards,
Jesús

longbkap...@gmail.com

unread,
Apr 10, 2018, 12:36:55 PM4/10/18
to Wazuh mailing list
Thanks Jesus. But I want to try something in code. Please help me

Vào 22:43:58 UTC+7 Thứ Hai, ngày 09 tháng 4 năm 2018, jesus.g...@wazuh.com đã viết:

jesus.g...@wazuh.com

unread,
Apr 11, 2018, 6:15:25 AM4/11/18
to Wazuh mailing list
Ok, if you want to modify by yourself any way, please follow my last tutorial but once done please go to: 

Kibana > Management > Saved Objects

Assuming you have customized the visualization named "Wazuh App Agents Overview Alerts summary",
search for it as follow:


Now mark the check square just next to the title and click on Export as follow:


You will download a JSON file with the visualization content:

[
 
{
   
"_id": "Wazuh-App-Agents-Overview-Alerts-summary",
   
"_type": "visualization",
   
"_source": {
     
"title": "Wazuh App Agents Overview Alerts summary",
     
"visState": "{\"title\":\"Wazuh App Agents Overview Alerts summary\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"rule.id\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":50,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Rule ID\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"rule.description\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":1,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Description\"}},{\"id\":\"4\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"rule.level\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":1,\"order\":\"desc\",\"orderBy\":\"1\",\"customLabel\":\"Level\"}}]}",
     
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
     
"description": "",
     
"version": 1,
     
"kibanaSavedObjectMeta": {
       
"searchSourceJSON": "{\"index\":\"wazuh-alerts-3.x-*\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
     
}
   
}
 
}
]

Now open the Wazuh App source code and look at the file located at:

/wazuh-kibana-app/server/integration-files/app-objects-file-alerts.json

My used visualization was Wazuh-App-Agents-Overview-Alerts-summary so the next step is to search for it on the JSON file and replace it. Once
done save the file and force the reload of the main indices as follow:

# curl -XDELETE localhost:9200/.kibana,.wazuh,.wazuh-version

Now restart Kibana. 

Note 1: on our next packages the file will be named different and will work on a different way. The process to edit them will be slightly different.
Note 2: as you can understand, you can break the App modifying the .kibana index and/or visualizations so be careful.

Hope it helps!

Best regards,
Jesús
Reply all
Reply to author
Forward
0 new messages