File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 6.13.1
1+ 6.14.0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Create Aerospike indexes if not exists
4+
5+ function create_index() {
6+ local namespace=$1
7+ local set=$2
8+ local bin=$3
9+ local index_name=$4
10+ local index_type=$5
11+
12+ echo " INFO: Creating index $index_name on $namespace .$set ($bin )"
13+ echo " enable; manage sindex create $index_type $index_name ns $namespace set $set bin $bin " | asadm
14+
15+ if [ $? -ne 0 ]; then
16+ echo " ERROR: Could not create index $index_name on $namespace .$set ($bin ), exiting..."
17+ fi
18+ }
19+
20+ # Check if asadm is installed
21+ if ! command -v asadm & > /dev/null; then
22+ echo " ERROR: asadm could not be found, please install Aerospike tools, exiting..."
23+ exit 1
24+ fi
25+
26+ # Create indexes if not exists
27+ create_index " malware" " urlScores" " list_type" " index_url_list" " string"
28+ create_index " malware" " urlScores" " score" " index_url_score" " numeric"
29+ create_index " malware" " hashScores" " list_type" " idx_events_src_ip" " string"
30+ create_index " malware" " hashScores" " score" " index_hash_score" " numeric"
31+ create_index " malware" " ipScores" " list_type" " index_ip_list" " string"
32+ create_index " malware" " ipScores" " score" " index_ip_score" " numeric"
33+ create_index " malware" " controlFiles" " hash" " index_hash_controlFiles" " string"
34+ create_index " malware" " mailQuarantine" " sensor_uuid" " index_mail_quarantine" " string"
You can’t perform that action at this time.
0 commit comments