ChrisYounger / git_for_splunk

Simple versioning for your Splunk environment
https://splunkbase.splunk.com/app/4182
Apache License 2.0
36 stars 10 forks source link

Status board is not populated after changing "git add --all" command to "git add *.conf" #3

Open axano opened 4 years ago

axano commented 4 years ago

I changed "git add --all" command to "git add *.conf" in bin/input_module_gitforsplunk.py.

The changes are pushed correctly to the git server that i have but the status board in the splunk app is blank (no success or failure).

I do see that although the commands are executed by the gitcmd function, they do not produce the COMMAND: , OUTPUT: output that i assume you are filtering on.

image

ChrisYounger commented 4 years ago

If you only want to track changes of .conf files then you should do this using a .gitignore file instead.

Here is the documentation: https://git-scm.com/docs/gitignore

And this is an example .gitignore file that should work for your problem:

#ignore all kind of files
*
#except conf files
!*.conf

If you are configuring gitforsplunk to look at the SPLUNK_HOME/etc/ folder, then you should put the above contents into the fie SPLUNK_HOME/etc/.gitignore

All the best

axano commented 4 years ago

I tried your gitignore suggestion but then it does not track .conf file recursively in the subdirectories

axano commented 4 years ago

nevertheless, the issue lies not in the modification of the code but in the fact that the dashboard is not populated correctly. I assume that this has to do with the length of the output comming from thr git commands issued as after adjusting the code around 15k of lines are produced as output.

ChrisYounger commented 4 years ago

Yes you are correct. The first commit is often very large and will be bigger than the props-TRUNCATE setting. Future commits should be fine unless there are tons of changes.