All Apps and Add-ons

DB Connect App and CSV with header

pisc
Explorer

DB Connect AppでMS SQL Serverからデータを取得しているのですが、SQLで選択するカラム数が変更になることが予測されるので、OutputをCSV with headerで取得し、ヘッダ行をフィールドに割り当てようと考えています。

実際のCSVファイルを直接読み込んだ際には、props.confにCHECK_FOR_HEADERの設定をして、1行目のヘッダ行をフィールドに割り当てることができているのですが、DB Connect AppでCSV with headerで取得した際に、思ったように動きません。
(1行目のヘッダ行もレコードとして取得されてしまう)

何か注意点などありますでしょうか?
設定のサンプル等教えて頂けると助かります。

0 Karma
1 Solution

melonman
Motivator

CSVでヘッダを固定してしまうと、変更にはうまく対応できないとおもいます。

select * from tab名 等として取得して、フォーマットをKVで指定すれば、
取り込み時に結果のテーブルに存在するカラムがkey=valueのkeyとして
自動的にセットされた状態でIndexされます。

View solution in original post

0 Karma

melonman
Motivator

CSVでヘッダを固定してしまうと、変更にはうまく対応できないとおもいます。

select * from tab名 等として取得して、フォーマットをKVで指定すれば、
取り込み時に結果のテーブルに存在するカラムがkey=valueのkeyとして
自動的にセットされた状態でIndexされます。

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...