Splunk Search

Getting duplicate rename fields error after upgrade from 6.3.0 to 6.4.2

bandit
Motivator

The following search worked prior to upgrade:

| stats sparkline count dc(sourcetype) as sourcetype last(_raw) as last_raw_msg values(sourcetype) as sourcetype last(_time) as earliest_msg_time first(_time) as latest_msg_time values(index) as index by punct
| eval delta=round((latest_msg_time-earliest_msg_time),0)
| eval msg_per_sec=round((count/delta),2)
| convert ctime(earliest_msg_time) ctime(latest_msg_time)
| table last_raw_msg count sourcetype sparkline msg_per_sec sourcetype earliest_msg_time latest_msg_time
| sort -count

Error in 'stats' command: 1 duplicate rename field(s)

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

You do have a duplicate stats functions dc(sourcetype) as sourcetype and values(sourcetype) as sourcetype. I can't imagine this would have worked in 6.3.0.

Any how, you can (should) change the name of one of them.

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

You do have a duplicate stats functions dc(sourcetype) as sourcetype and values(sourcetype) as sourcetype. I can't imagine this would have worked in 6.3.0.

Any how, you can (should) change the name of one of them.

bandit
Motivator

Thanks, Somesh
My brain wasn't registering that "as" is equivalent to the "rename" command.

Rob

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