Solved
Elasticsearch OSS-7.0.0
Curator 5.7
I recently had trouble running Curator on a Windows server in which I could run .\curator curator-action.yml --config curator-config.yml to delete indices older than a set amount of time. When I would run the cmd in Powershell it seemingly "wouldn't" run, the cmd would just start the next cmd line in Powershell.
In the curator-config.yml I added a path to logfile line. Seems like stdout doesnt work for the error messages? Maybe an Elastic Team Member can elaborate on that a bit.
#Curator configuration
client:
hosts:
- http://abc1234.gov
port: 9200
url_prefix:
timeout: 100
master_only: False
logging:
loglevel: INFO
logfile: D:\curator-5.7.6-amd64\logs\curator.txt
logformat: default
blacklist: [‘elasticsearch’]
This added data to the .txt file that in which the only seemingly useful part of the error message was [Errno 11001] getaddrinfo failed
2019-09-04 13:11:50,920 INFO Preparing Action ID: 1, "delete_indices"
2019-09-04 13:11:50,935 WARNING GET http://abc1234.gov:9200/ [status:N/A request:0.016s]
Traceback (most recent call last):
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connection.py", line 159, in _new_conn
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\util\connection.py", line 57, in create_connection
File "C:\Program Files\Python36\lib\socket.py", line 745, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\elasticsearch\connection\http_urllib3.py", line 220, in perform_request
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 638, in urlopen
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\util\retry.py", line 344, in increment
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\packages\six.py", line 686, in reraise
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 600, in urlopen
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connectionpool.py", line 354, in _make_request
File "C:\Program Files\Python36\lib\http\client.py", line 1239, in request
File "C:\Program Files\Python36\lib\http\client.py", line 1285, in _send_request
File "C:\Program Files\Python36\lib\http\client.py", line 1234, in endheaders
File "C:\Program Files\Python36\lib\http\client.py", line 1026, in _send_output
File "C:\Program Files\Python36\lib\http\client.py", line 964, in send
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connection.py", line 181, in connect
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connection.py", line 168, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000017FD4693B70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
2019-09-04 13:11:51,935 WARNING GET http://abc1234.gov:9200/ [status:N/A request:0.000s]
Traceback (most recent call last):
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\connection.py", line 159, in _new_conn
File "C:\Users\aaron\AppData\Roaming\Python\Python36\site-packages\urllib3\util\connection.py", line 57, in create_connection
File "C:\Program Files\Python36\lib\socket.py", line 745, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed
A quick Google search led me to believe that this was a syntax error of some nature or that I had to change the domain name to an ip. I started with the syntax part and changed http://abc1234.gov to http://ABC1234.gov which fixed the problem. With this issue out of the way I was able to run a greater than 92 day indices deletion of metricbeats and heartbeat with the curator-action.yml below.
#Delete metricbeats older than 5 days.
actions:
1:
action: delete_indices
description: >-
Delete metricbeat indices older than 92 days
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: metricbeat-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 92
2:
action: delete_indices
description: >-
Delete heartbeat indices older than 92 days
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: heartbeat-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 92