Getting Data In

日本語文字列に対するSEDCMDについて

sunrise
Contributor

WMIポーリングで取得したWindowsイベントログをSEDCMD属性で置換したいのですが、
下記のprops.confを設定してもうまく置換されません。
何か対応方法ございますでしょうか。

<props.conf>

[WMI:WinEventLog:Security]
SEDCMD-win = s/ログオン/ログオンです/g

ちなみに英語の場合には置換することが出来ました。

0 Karma
1 Solution

melonman
Motivator

Windows環境ではない(Macosのローカルファイル)ですが、SJISでデータを取り込む際、props.conf内で、SEDCMDでIndex-timeトランスフォームを設定して見たところ、SEDが聞いた状態でイベントが取り込まれました。(想定通り)

すでに取り込まれたデータに対しては、rex mode=sed "s/xxx/yyy/g"などとしていただければサーチ時の変換は可能かと思いますが、いかがでしょうか。

元データ

alt text

Props.conf

[sjis]
CHARSET = SJIS
NO_BINARY_CHECK = 1
pulldown_type = 1
SEDCMD-win = s/ログオン/セッドでログオンです/g

Splunkに取り込までたあとの表示

alt text

View solution in original post

0 Karma

melonman
Motivator

Windows環境ではない(Macosのローカルファイル)ですが、SJISでデータを取り込む際、props.conf内で、SEDCMDでIndex-timeトランスフォームを設定して見たところ、SEDが聞いた状態でイベントが取り込まれました。(想定通り)

すでに取り込まれたデータに対しては、rex mode=sed "s/xxx/yyy/g"などとしていただければサーチ時の変換は可能かと思いますが、いかがでしょうか。

元データ

alt text

Props.conf

[sjis]
CHARSET = SJIS
NO_BINARY_CHECK = 1
pulldown_type = 1
SEDCMD-win = s/ログオン/セッドでログオンです/g

Splunkに取り込までたあとの表示

alt text

0 Karma

sunrise
Contributor

Windows環境でも無事SEDCMD属性が使えました。やはり、props.confの文字コードが原因でした。Windows Server上にSplunkを構築する際には設定ファイル(conf)を全てUTF-8で保存する癖をつけないとダメですね。。。

0 Karma

sunrise
Contributor

別の方法(props.confとtrasnforms.conf)で検証していたところ、設定ファイルの文字コードがUTF-8である必要がありそうです。

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...