Splunk Search

How to count the number of columns in a file

mahbs
Path Finder

Hi,

I'm trying to do a comparison, wherein I want to verify that the number of columns in file X matches the number of columns in file Y.

Its literally a comparison of two figures.

Does anyone have any idea? I was thinking of using fieldsummary, but I'm not quite sure on how to implement it

Thanks

Tags (1)
0 Karma

cmerriman
Super Champion

Are these indexes or lookups?

At any rate, to do it for one, you’d use something like ...|fieldsummary |stats count as fields And you can join or append the other file

0 Karma

mayurr98
Super Champion

Can you please elaborate your question?
Give us sample input data and tell us the output you want so that I can write a query for you.

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...