Skip to content

Commit

Permalink
Use splunk_api for Remove existing HEC token (#818)
Browse files Browse the repository at this point in the history
* Use splunk_api for Remove existing HEC token

* Add svc_port

---------

Co-authored-by: Erik Horton <[email protected]>
  • Loading branch information
hortonew and Erik Horton authored Apr 25, 2024
1 parent 9d8361b commit 7f71446
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions roles/splunk_common/tasks/set_as_hec_receiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@

# The REST API does not support modifying tokens in-place, so we'll need to delete/re-create
- name: Remove existing HEC token
uri:
url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/services/data/inputs/http/splunk_hec_token"
splunk_api:
url: "/services/data/inputs/http/splunk_hec_token"
method: DELETE
user: "{{ splunk.admin_user }}"
cert_prefix: "{{ cert_prefix }}"
username: "{{ splunk.admin_user }}"
password: "{{ splunk.password }}"
status_code: 200,404
status_code: [200, 404]
svc_port: "{{ splunk.svc_port }}"
timeout: 60
use_proxy: no
register: delete_hec_token
Expand Down

0 comments on commit 7f71446

Please sign in to comment.