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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...