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 Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...