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

Change log level in cfg and CLI #187

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

arcsector
Copy link
Contributor

Summary

Changes the log-level at the CLI level, then makes sure log-local.cfg exists, and adds or modifies the the log level in there. Requires the variables splunk_component and splunk_component_log_level provided to the task.

Modified files

  • Added: roles/tasks/adhoc_change_log_level.yml
  • Changed: README.md

@jewnix jewnix added the enhancement New feature or request label Jun 5, 2023
@arcsector
Copy link
Contributor Author

Made some changes to put the unfound items at the top of the file. Note that even if you set the file correctly, and the REST API shows you have set the log level correctly at /services/server/logger, Splunk still refuses to log at DEBUG for certain components (noticing this on an indexer with components HttpInputQueue, STMgr, TcpInputProc, and a couple other tests, but other components do work with this method like HttpInputDataHandler... Cmon Splunk!)

owner: "{{ splunk_nix_user }}"
group: "{{ splunk_nix_group }}"
mode: preserve
become: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing become_user

@jewnix
Copy link
Collaborator

jewnix commented Jun 7, 2023

@arcsector

  1. The splunk set log-level is not persistent, and is only used to change the level on a running instance temporarily.
  2. Can you add the option to configure multiple components to different levels in a loop?

@arcsector
Copy link
Contributor Author

  1. Yes, this is the desired functionality, change the level now, and then do it persistently so a restart isn't necessary. I can remove the restart handle to reflect this.
  2. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants