SumoLogic-Labs / collector-management-client

A Python script for quickly managing a subset of installed Collectors
Apache License 2.0
22 stars 20 forks source link

Duplicate results returned on -getSources #25

Open yn-cm opened 4 years ago

yn-cm commented 4 years ago

Hello,

New user here. Is it expected behavior for the -getSources command to return duplicate entries? I filtered down to a single node for brevity but the same is observed without a filter. I'm not sure if this duplication extends to the -addSource or -updateSource command, or if it would cause issues if it did.

python3 sumo_mgmt.py -url https://api.us2.sumologic.com/api/v1/ -accessid $id -accesskey $key -filter name=xxxxxxxxxx -getSources

2020-06-30 13:53:10,421 -0400 [PROGRESS] fetching and sorting through the next 1 to 149 collectors 2020-06-30 13:53:10,425 -0400 [INFO] 2 total collectors +------------+-----------+-----------+----------+----------------+-------+ | name | id | version | category | sourceSyncMode | alive | +------------+-----------+-----------+----------+----------------+-------+ | xxxxxxxxxx | 184060513 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 184060513 | 19.288-10 | - | UI | True | +------------+-----------+-----------+----------+----------------+-------+ 2020-06-30 13:53:10,956 -0400 [PROGRESS] Finished source get for collector ID: 184060513 2020-06-30 13:53:11,416 -0400 [PROGRESS] Finished source get for collector ID: 184060513 2020-06-30 13:53:11,417 -0400 [INFO] 2 total sources +-------------+-------------------+------------+---------------------------+ | collectorid | name | id | category | +-------------+-------------------+------------+---------------------------+ | 184060513 | Windows Event Log | 1044949596 | prod/windows/workstations | | 184060513 | Windows Event Log | 1044949596 | prod/windows/workstations | +-------------+-------------------+------------+---------------------------+

python3 sumo_mgmt.py -url https://api.us2.sumologic.com/api/v1/ -accessid $id -accesskey $key -getSources 2020-06-30 14:47:00,286 -0400 [PROGRESS] fetching and sorting through the next 1 to 149 collectors

2020-06-30 14:47:00,314 -0400 [INFO] 276 total collectors +----------------+-----------+-----------+----------+----------------+-------+ | name | id | version | category | sourceSyncMode | alive | +----------------+-----------+-----------+----------+----------------+-------+ | xxxxxxxxxx | 185261133 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 185261133 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 185323018 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 185323018 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 185833644 | 19.288-10 | - | UI | True | | xxxxxxxxxx | 185833644 | 19.288-10 | - | UI | True |

Thanks in advance for your feedback.

Regards, Mike