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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...