【实践成果】Splunk 9.0 Configuration Change Tracking

news2024/11/29 5:35:30

Splunk 9.0 引入了新的功能,一个很重要的一个,就是跟踪conguration 文件的变化:

这个很重要的特性,在splunk 9.0 以后才引入,就看server.conf 配置中,9.0 以后的版本才有:

server.conf - Splunk Documentation

Configuration Change Tracker

[config_change_tracker]
disabled = <boolean>
* Whether or not splunkd writes configuration changes to the 
  configuration change log at $SPLUNK_HOME/var/log/splunk/configuration_change.log.
* If set to "false", configuration changes are captured in
  $SPLUNK_HOME/var/log/splunk/configuration_change.log.
* If set to "true", configuration changes are not captured
  in $SPLUNK_HOME/var/log/splunk/configuration_change.log.
* Default: false

mode = [auto|diff|track-only]
* Determines the method used by 'config_change_tracker' to track and record
  changes to .conf files.
* A value of "auto" or "diff" means splunkd logs all configuration changes made to
  .conf files, including changes to setting values. In this mode, config change
  tracking only includes changes that could have an effect on your environment.
  For example, if a file with a stanza and setting-value pair is created, updated,
  or deleted, splunkd logs the change. But if an empty file or a stanza without any
  setting-value pairs is added or deleted, splunkd does not log the change since it
  will not have an impact. Similarly, splunkd does not track any comments that are
  added to or removed from files.
* A value of "track-only" means splunkd logs .conf file changes, but excludes
  configuration setting values. In this mode, config change tracking includes
  changes whether or not they can have an effect on your environment. For example,
  splunkd logs a change for any updates to file content, or that come from a change
  by the operating system. Splunkd also sees a comment that has been added to a .conf
  file as a change, because that change results in a different file checksum.
* Splunkd tracks all .conf files under the following directories:
  * $SPLUNK_HOME/etc/system
  * $SPLUNK_HOME/etc/apps
  * $SPLUNK_HOME/etc/users
  * $SPLUNK_HOME/etc/peer-apps
  It also tracks changes to the following:
  * $SPLUNK_HOME/etc/instance.cfg
* The values "auto" and "diff" have the same behavior at this time. Setting the 
  value to "auto" ensures that the instance will always use the latest feature set.
* Default: auto

denylist = <regular expression>
* If set, splunkd does not monitor files for configuration change tracker if 
  their path matches the specified regex.
* No default.

log_throttling_disabled = <boolean>
* Describes whether or not splunkd logs config changes to a .conf file
  that occur within the 'log_throttling_threshold_ms' time span as a single event.
* A value of "false" means that splunkd logs all changes to a conf file within
  the time span 'log_throttling_threshold_ms' as a single event.
* A value of "true" means that splunkd logs all changes individually as
  soon as it detects them.
* This setting requires a Linux system with the "inotify" API for
  file system event monitoring.
* Do not change this setting without first consulting with Splunk Support.
* Default: true

log_throttling_threshold_ms = <positive integer>
* The span of time, in milliseconds, during which splunkd logs multiple
  changes to a .conf file as a single configuration change event.
* If multiple changes are made to a conf file within the time span
  'log_throttling_threshold_ms' milliseconds, splunkd logs those changes
  as a single event.
* Default: 10000

exclude_fields = <comma-separated list>
* If set, splunkd excludes the stanza key that you specify when it writes to the 
  configuration_change.log file.
* The format for each entry is '<conf-file>:<stanza>:<key>'. Separate multiple 
  entries with commas.
* To exclude all keys under a stanza, use the '<conf-file>:<stanza>:*' format.
* This setting has no effect when mode is set to "track-only".
* Example setting: 
  'server.conf:general:pass4SymmKey, authentication.conf:authentication:*'
* No default.

* NOTE: The [config_change_audit] stanza, which was previously mentioned in 
  the Splunk version 8.2.0 documentation and configuration specification files,
  is now DEPRECATED.


-

上面明确提到splunk8.2 是没有这个功能的。

下面实践一下这个功能:

先创建一个alert:

这样,就在如下的path 下面产生文件:

/opt/splunk/etc/users/sheng/search/下面产生savedsearches.conf 文件。

Everyweek / expire: 24 / is equal to=0

后来的修改:

Everyday / expire: 48 / is equal to=2

这个时候:看到如下的跟踪log 变化:

/opt/splunk/var/log/splunk/configuration_change.log

{"datetime":"09-30-2023 13:32:23.725 +0800","log_level":"INFO ","component":"ConfigChange","data":{"path":"/opt/splunk/etc/users/admin/search/local/savedsearches.conf","action":"update","modtime":"Sat Sep 30 13:32:22 2023","epoch_time":"1696051943","new_checksum":"0xd41d8cd98f00b204","old_checksum":"0x7e9b3519314c7f2b","changes":[{"stanza":"coubase_alert","properties":[{"name":"action.email","new_value":"","old_value":"1"},{"name":"action.email.to","new_value":"","old_value":"shp@163.com"},{"name":"action.email.useNSSubject","new_value":"","old_value":"1"},{"name":"action.webhook.enable_allowlist","new_value":"","old_value":"0"},{"name":"alert.expires","new_value":"","old_value":"48h"},{"name":"alert.suppress","new_value":"","old_value":"0"},{"name":"alert.track","new_value":"","old_value":"0"},{"name":"counttype","new_value":"","old_value":"number of events"},{"name":"cron_schedule","new_value":"","old_value":"0 0 * * *"},{"name":"dispatch.earliest_time","new_value":"","old_value":"-1d"},{"name":"dispatch.latest_time","new_value":"","old_value":"now"},{"name":"enableSched","new_value":"","old_value":"1"},{"name":"quantity","new_value":"","old_value":"2"},{"name":"relation","new_value":"","old_value":"equal to"},{"name":"request.ui_dispatch_app","new_value":"","old_value":"search"},{"name":"request.ui_dispatch_view","new_value":"","old_value":"search"},{"name":"search","new_value":"","old_value":"index=abc_base"}]}]}}

很好:下面开始change alert 来对比一下:

index=_configtracker "data.path"="*savedsearches.conf"
| spath output=modtime data.modtime,
| spath output=path data.path,
| spath output=stanza data.changes{}.stanza,
| spath output=name data.changes{}.properties{}.name,
| spath output=new_value data.changes{}.properties{}.new_value,
| spath output=old_value data.changes{}.properties{}.old_value,
| table modtime path name prop_name new_value old_value

参考链接:

https://www.splunk.com/en_us/blog/platform/splunking-your-conf-files-how-to-audit-configuration-changes-like-a-boss.html

 https://hurricanelabs.com/splunk-tutorials/first-look-splunk-9-0-configuration-change-logging/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1052243.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【STL巨头】set、map、multiset、multimap的介绍及使用

set、map、multiset、multimap的介绍及使用 一、关联式容器二、键值对键值对概念定义 三、setset的介绍set的使用set的模板参数列表set的构造set的迭代器set的容量emptysize set的修改操作insertfind && erasecountlower_bound 和 upper_bound Multiset的用法 四、mapm…

WebGL笔记:绘制矩形面的几种方式以及封装封装多边形对象来绘制不同图形

绘制矩形面 可以绘制的面只有三角面&#xff0c;要绘制矩形面的话&#xff0c;只能用两个三角形去拼 1 &#xff09; 使用 三角带 TRIANGLE_STRIP 绘制矩形 回顾一下之前的规律&#xff1a; 第一个三角形&#xff1a;v0>v1>v2第偶数个三角形&#xff1a;以上一个三角形…

预编译(2)

#和## #运算符&#xff1a; #运算符将宏的⼀个参数转换为字符串字⾯量。它仅允许出现在带参数的宏的替换列表中。 #运算符所执⾏的操作可以理解为“字符串化”。 举例&#xff1a; 当我们有⼀个变量 int a 10; 的时候&#xff0c;我们想打印出&#xff1a; the value of …

volatile修饰数组

结论&#xff1a;volatile修饰对象或数组时&#xff0c;只能保证他们的引用地址的可见性。 非volatile数组的可见性问题 public class Test {static int[] a new int[]{1};public static void main(String[] args) {new Thread(() -> { //线程Atry {Thread.sleep(1000);}…

ElasticSearch一对多关系方案

一、前言 使用MySQL做为存储&#xff0c;表与表之间有很多是一对多关系&#xff0c;比如订单和订单商品明细&#xff0c;客户和客户地址等等&#xff0c;但是因为ES本身是扁平化文档结构&#xff0c;一般不同索引之间是没有关系的&#xff0c;ES在处理这种关系时相比MySQL并不…

Python计算巴氏距离

Python计算巴氏距离 巴氏距离简介 在统计中&#xff0c;巴氏距离&#xff08;Bhattacharyya Distance&#xff09;测量两个离散或连续概率分布的相似性。它与衡量两个统计样品或种群之间的重叠量的巴氏系数密切相关。巴氏距离和巴氏系数以20世纪30年代曾在印度统计研究所工作…

分布式事务-TCC异常-幂等性

1、幂等性问题&#xff1a; 二阶段提交时&#xff0c;如果二阶段执行成功通知TC时出现网路或其他问题中断&#xff0c;那么TC没有收到执行成功的通知&#xff0c;TC内部有定时器不断的重试二阶段方法&#xff0c;导致接口出现幂等性问题。 2、解决方法 和空回滚问题一样也是…

Elastic SQL 输入:数据库指标可观测性的通用解决方案

作者&#xff1a;Lalit Satapathy, Ishleen Kaur, Muthukumar Paramasivam Elastic SQL 输入&#xff08;metricbeat 模块和输入包&#xff09;允许用户以灵活的方式对许多支持的数据库执行 SQL 查询&#xff0c;并将结果指标提取到 Elasticsearch。 本博客深入探讨了通用 SQL …

基于SpringBoot的课程答疑系统

目录 前言 一、技术栈 二、系统功能介绍 学生信息管理 科目类型管理 老师回答管理 我的收藏管理 学生问题 留言反馈 交流区 三、核心代码 1、登录模块 2、文件上传模块 3、代码封装 前言 随着信息互联网信息的飞速发展&#xff0c;无纸化作业变成了一种趋势&#x…

SPSS探索性分析

前言&#xff1a; 本专栏参考教材为《SPSS22.0从入门到精通》&#xff0c;由于软件版本原因&#xff0c;部分内容有所改变&#xff0c;为适应软件版本的变化&#xff0c;特此创作此专栏便于大家学习。本专栏使用软件为&#xff1a;SPSS25.0 本专栏所有的数据文件可在个人主页—…

求解平面上物体的有向3d包围盒

算法流程&#xff1a; &#xff08;1&#xff09;点云下采样&#xff08;体素滤波&#xff09;&#xff1b; &#xff08;2&#xff09;ransac算法分割拟合地面平面&#xff1b; &#xff08;3&#xff09;裁剪工作区域&#xff08;指定空间中四个点&#xff0c;裁剪点云只保留…

C++_基础语法

一、关键字 常用语法 #include<iostream>using namespace std;// 全局常量 #define DAY 30void main() {/** 变量与输出*/// 局部常量const int year 2023;// 控制台输出cout << "hello world" << endl;cout << "天&#xff1a;"…

国庆加速度!新增功能点锁定功能,敏捷开发新增估算功能,助力项目快速突破!

大家好&#xff0c;CoCode开发云旗下Co-Project V3.6智能项目管理平台正式发布&#xff0c;平台新增功能点锁定功能、敏捷开发模式新增估算板块和两种估算方式。 功能点锁定功能进一步提高了项目估算的灵活性和准确性&#xff0c;有利于提高项目估算效率&#xff1b;而敏捷开发…

Unity2023打包首包从78Mb到3.0Mb-震惊-我做对了什么

&#xff08;全程并没有使用AssetBundle , 历史原因&#xff0c;Resources目录还有不少资源残留&#xff09; 曾经的我在2019打包过最小包10m左右&#xff0c;后来发现到了Unity2020之后暴增到40m&#xff0c;又加上2023版本URP&#xff0c;1个Unity输出包可能至少55M 如下图…

Ubuntu基于Docker快速配置GDAL的Python、C++环境

本文介绍在Linux的Ubuntu操作系统中&#xff0c;基于Docker快速配置Python、C等不同编程语言均可用的地理数据处理库GDAL的方法。 首先&#xff0c;我们访问GDAL库的Docker镜像官方网站&#xff08;https://github.com/OSGeo/gdal/tree/master/docker&#xff09;。其中&#x…

Abstract Factory 抽象工厂模式简介与 C# 示例【创建型】

〇、简介 1、什么是抽象工厂模式&#xff1f; 一句话解释&#xff1a; 提供一个接口&#xff0c;以创建一系列相关或相互依赖的抽象对象&#xff0c;而无需指定它们具体的类。&#xff08;将一系列抽象类装进接口&#xff0c;一次接口实现&#xff0c;就必须实例化这一系列抽象…

如何在Ubuntu中切换root用户和普通用户

问题 大家在新装Ubuntu之后&#xff0c;有没有发现自己进入不了root用户&#xff0c;su root后输入密码根本进入不了&#xff0c;这怎么回事呢&#xff1f; 打开Ubuntu命令终端&#xff1b; 输入命令&#xff1a;su root&#xff1b; 回车提示输入密码&#xff1b; 提示&…

[ubuntu]ubuntu设置虚拟内存

首先查看自己是否加过虚拟内存或者查看虚拟内存当前状态可以命令&#xff1a; free -mh 创建交换分区&#xff1a; sudo mkdir /swap cd /swap sudo dd if/dev/zero ofswapfile bs1024 count12582912 其中count是自己分配内存大小&#xff0c;上面为12GB&#xff0c;你可…

视频异常检测:Human Kinematics-inspired Skeleton-based Video Anomaly Detection

论文作者&#xff1a;Jian Xiao,Tianyuan Liu,Genlin Ji 作者单位&#xff1a;Nanjing Normal University;The Hong Kong Polytechnic University 论文链接&#xff1a;http://arxiv.org/abs/2309.15662v1 内容简介&#xff1a; 1&#xff09;方向&#xff1a;视频异常检测…

Opengl之混合

OpenGL中,混合(Blending)通常是实现物体透明度(Transparency)的一种技术。透明就是说一个物体(或者其中的一部分)不是纯色(Solid Color)的,它的颜色是物体本身的颜色和它背后其它物体的颜色的不同强度结合。一个有色玻璃窗是一个透明的物体,玻璃有它自己的颜色,但它最终的…