0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Splunk SPL 小ネタ | eval{field}

Last updated at Posted at 2024-05-13

Splunk Version 9.2.1

SPLで気づきにくい便利コマンドの紹介

下記のデータについて、my_int フィールドを値別に別フィールドで管理したい場合

image.png

下記SPLを使うと便利

qiita.rb
| eval {field} = field

 ※勿論 eval式なので、= 以下は変数でも定数でも可。

image.png

my_intの値を、1, 3 にするとこんな感じになる。

image.png

SPL例

qiita.rb
| makeresults format=csv
data="my_int,my_char
1,aaa
1,bbb
3,ccc
3,ddd"
| table my_int my_char

| eval {my_int} = my_int

記事終了

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?