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!

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