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 | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...