Splunk Dev

Custom command with argument as string not stanza-how to change it to be just *| cloudcidrlookup azure* ?

irom77
Explorer

I have created custom command *| cloudcidrlookup cloud=azure* but how to change it to be just *| cloudcidrlookup azure* ?

 

 

@Configuration()
class CloudCidrLookup(GeneratingCommand):
    cloud = Option(require=False)  
    ...
    def generate(self):
        if self.cloud=='azure':
        ...
dispatch(CloudCidrLookup, sys.argv, sys.stdin, sys.stdout, __name__)

 

 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Refer to the field name by index rather than by name.

cloud = self.fieldnames[0]
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Refer to the field name by index rather than by name.

cloud = self.fieldnames[0]
---
If this reply helps you, Karma would be appreciated.
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 ...