<commit_before># This sample script demonstrates the use of verbs provided for manipulating
# with groups. The verbs are defined by Orion.Container entity type.
#
# The script progresses in several steps, it:
# 1. Creates a new group with initial members.
# 2. Adds a new member in the group.
# 3. Adds multiple new members in the group using a single service call.
# 4. Updates an existing member with a new definition.
# 5. Deletes an existing member from the group.
# 6. Updates the group properties (e.g. name and refresh frequency)
# 7. Replaces the group members with a new set of members.
# 8. Deletes the group.
#
# Please update the hostname and credential setup to match your configuration.

# Connect to SWIS
$hostname = "localhost"
$username = "admin"
$password = New-Object System.Security.SecureString
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -host $hostname -cred $cred

#
# CREATING A NEW GROUP
#
# Creating a new group with initial Cisco and Windows devices.
#
<commit_msg>Filter Operator Samples<commit_after># This sample script demonstrates the use of verbs provided for manipulating
# with groups. The verbs are defined by Orion.Container entity type.
#
# The script progresses in several steps, it:
# 1. Creates a new group with initial members.
# 2. Adds a new member in the group.
# 3. Adds multiple new members in the group using a single service call.
# 4. Updates an existing member with a new definition.
# 5. Deletes an existing member from the group.
# 6. Updates the group properties (e.g. name and refresh frequency)
# 7. Replaces the group members with a new set of members.
# 8. Deletes the group.
#
# Please update the hostname and credential setup to match your configuration.

# Connect to SWIS
$hostname = "localhost"
$username = "admin"
$password = New-Object System.Security.SecureString
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$swis = Connect-Swis -host $hostname -cred $cred

#
# CREATING A NEW GROUP
#
# Creating a new group with initial Cisco and Windows devices.
#

<# Filter samples w/ all operators:

IP_Address is 192.168.10.10
filter:\Orion.Nodes[IP_Address='192.168.10.10')]

IP_Address is not 192.168.10.10
filter:\Orion.Nodes[IP_Address!='192.168.10.10']

IP_Address starts with 192.168.10.
filter:/Orion.Nodes[StartsWith(IP_Address,'192.168.10.')]

IP_Address ends with .10.%
filter:\Orion.Nodes[EndsWith(IP_Address,'10.%')]

IP_Address contains .10.
filter:\Orion.Nodes[Contains(IP_Address,'.10.')]

IP_Address matches 192.168.*
filter:\Orion.Nodes[Pattern(IP_Address,'192.168.%')]

#>

{'fraction_non_alphanumeric': 0.09546805349182763, 'fraction_numerical': 0.03417533432392273, 'mean_word_length': 4.353876739562624, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691146', 'n_tokens_mistral': 890, 'n_tokens_neox': 791, 'n_words': 330}