Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Parliament JSON #2395

Merged
merged 10 commits into from Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
98 changes: 97 additions & 1 deletion db/db.pl
Expand Up @@ -72,7 +72,7 @@
# 76 - views index
# 77 - cron sharing with roles and users
# 78 - added roleAssigners to users
# 79 - added parliament notifier flags
# 79 - added parliament notifier flags to notifiers index and new parliament index

use HTTP::Request::Common;
use LWP::UserAgent;
Expand Down Expand Up @@ -5683,6 +5683,101 @@ sub notifiersAddMissingProps
}
}
################################################################################
sub parliamentCreate
{
my $settings = '
{
"settings": {
"index.priority": 30,
"number_of_shards": 1,
"number_of_replicas": 0,
"auto_expand_replicas": "0-3"
}
}';

logmsg "Creating parliament_v50 index\n" if ($verbose > 0);
esPut("/${PREFIX}parliament_v50?master_timeout=${ESTIMEOUT}s", $settings);
esAlias("add", "parliament_v50", "parliament");
parliamentUpdate();
}

sub parliamentUpdate
{
my $mapping = '
{
"_source": {"enabled": "true"},
"dynamic": "strict",
"properties": {
31453 marked this conversation as resolved.
Show resolved Hide resolved
"name": {
"type": "keyword"
},
"settings": {
"type": "object",
"dynamic": "true",
"enabled": "false"
},
"groups": {
"type": "object",
"properties": {
"title": {
"type": "keyword"
},
"description": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"clusters": {
"type": "object",
"properties": {
"title": {
"type": "keyword"
},
"description": {
"type": "keyword"
},
"url": {
"type": "keyword"
},
"localUrl": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"id": {
"type": "keyword"
},
"hideDeltaBPS": {
"type": "boolean"
},
"hideDeltaTDPS": {
"type": "boolean"
},
"hideMonitoring": {
"type": "boolean"
},
"hideMolochNodes": {
"type": "boolean"
},
"hideDataNodes": {
"type": "boolean"
},
"hideTotalNodes": {
"type": "boolean"
}
}
}
}
}
}
}';

logmsg "Setting parliament_v50 mapping\n" if ($verbose > 0);
esPut("/${PREFIX}parliament_v50/_mapping?master_timeout=${ESTIMEOUT}s&pretty", $mapping);
}
################################################################################

################################################################################
sub viewsCreate
Expand Down Expand Up @@ -7942,6 +8037,7 @@ sub dataNodes
queriesUpdate();
notifiersUpdate();
notifiersAddMissingProps();
parliamentCreate();
} else {
logmsg "db.pl is hosed\n";
}
Expand Down