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!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...