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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...