Getting Data In

誤って追加してしまったデータの削除方法

tonakano
Engager

ご教授ください。

PC上のフォルダを指定して、データのアップロードを行いました。(モニタで登録しました。):データA
この状態で、ダッシュボードを作り、一旦の日の目を見たのですが、別データも取り込んで
拡張的な分析をしようと思ったときに、誤って上のフォルダの中身を更新してしまいました。:データB

その結果、該当のIndexerがデータA+データBにアップデートされました。。。

一旦Indexerを削除して作り直すことも考えましたが、上記したように、このIndexerを基本とした
ダッシュボードを作りきっていること、とりあえず現行ダッシュボード上はデータAのfiledだけを参照する
形のため、更新は遅いものの使えていることから、Indexerの作り直しをためらっております。
どうにか、データBだけを当該Indexerから消せないものかと思ったのですが、方法が分かりません。

何か方法はあるものでしょうか?

初心者質問で恐縮ですが、宜しくお願いします。

Tags (2)
0 Karma
1 Solution

oda
Communicator

もしsourcetypeが異なるようであれば
jacobevans さんが回答している内容で削除してください。

同一のsourcetypeであれば下記のコマンドで取り込みを行った時間を表示することが可能です。

index=someindex | eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S")

その後、誤って取り込んでしまった時刻のデータのみに絞り込み
| delete
コマンドで削除してください。

View solution in original post

0 Karma

oda
Communicator

もしsourcetypeが異なるようであれば
jacobevans さんが回答している内容で削除してください。

同一のsourcetypeであれば下記のコマンドで取り込みを行った時間を表示することが可能です。

index=someindex | eval indextime=strftime(_indextime,"%Y-%m-%d %H:%M:%S")

その後、誤って取り込んでしまった時刻のデータのみに絞り込み
| delete
コマンドで削除してください。

0 Karma

tonakano
Engager

ありがとうございます。
sourcetypeも同一であるため、取り込み時刻を限定してやってみます。

0 Karma

jacobpevans
Motivator

Create a search that returns the data you want to delete, e.g.:

index=someindex sourcetype=dataB

Then, just pipe it to the delete command.

index=someindex sourcetype=dataB | delete

https://docs.splunk.com/Documentation/Splunk/latest/Indexer/RemovedatafromSplunk


[From Google Translate]

削除するデータを返す検索を作成します。例:

インデックス=何らかのインデックスソースタイプ=データB

次に、削除コマンドにパイプします。

インデックス=何らかのインデックスソースタイプ=データB | 削除する

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.

anthonymelita
Contributor

To delete data in the method described, the user requires the can_delete role.

説明した方法でデータを削除するには、ユーザーにcan_deleteロールが必要です。

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 ...