Skip to content
Snippets Groups Projects
Commit 357f6012 authored by Arne Øslebø's avatar Arne Øslebø
Browse files

make kibana_graphs a template

parent efe7e164
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,15 @@ To make modifications to the main NiFi pipeline and add it to the Ansible playbo
* Convert flowx.xml.gz to new template
`utils/flow2template.py flow.xml.gz roles/nifi/templates/flow.xml.j2`
Update Kibana dashboards
------------------------
* Make necesarry changes to the dashboards or visualizations in the Kibana GUI
* Export objects by going to "Management->Saved Objects" and click on the "Export objects" link. Select all objects.
* Copy the exported file,export.ndjson, to the soctools directory
* Convert export.ndjson to a new template
`utils/kibana_graphs2template.py export.ndjson roles/odfekibana/templates/kibana_graphs.ndjson.j2`
Update configuration files in docker containers using Ansible
-------------------------------------------------------------
......
This diff is collapsed.
......@@ -115,8 +115,8 @@
- name: Copy kibana_graphs.ndjson to container
remote_user: kibana
copy:
src: "files/kibana_graphs.ndjson"
template:
src: "kibana_graphs.ndjson.j2"
dest: /tmp/kibana_graphs.ndjson
- name: Import graphs to kibana
......
......@@ -28,7 +28,7 @@
- name: Copy kibana_graphs.ndjson to container
remote_user: kibana
copy:
src: "files/kibana_graphs.ndjson"
template:
src: "kibana_graphs.ndjson.j2"
dest: /tmp/kibana_graphs.ndjson
#!/usr/bin/env python
import argparse,re
parser = argparse.ArgumentParser()
parser.add_argument("graphsfile", help="input kibana_graphs.ndjson file")
parser.add_argument("templatefile", help="output template file")
args = parser.parse_args()
r=open(args.graphsfile,"r")
w=open(args.templatefile,"w")
for line in r:
w.write(re.sub(r'(^.*thehive_button\\\",\\\"params\\\":{\\\"url\\\":\\\")[^\\"]*(.*apikey\\\":\\\")[^\\\"]*(.*owner\\\":\\\")[^\\"]*(.*$)',"\g<1>{{THEHIVE_URL}}\g<2>{{THEHIVE_API_KEY}}\g<3>{{THEHIVE_OWNER}}\g<4>",line))
r.close()
w.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment