Splunk Search

Is there a way to dynamically create fields and assign them values while my script is being executed in Splunk for a custom search?

kalyani_y
Explorer

Is there any way to create fields and assign values to them while my script is being executed for custom search?

0 Karma
1 Solution

woodcock
Esteemed Legend

Yes, that is what eval and rex do, among others.

http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/Eval
http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/Rex

If you mean that persist outside the scope of the run of your search, then you need to use outputcsv followed by inputcsv the next time around.

View solution in original post

woodcock
Esteemed Legend

Yes, that is what eval and rex do, among others.

http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/Eval
http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/Rex

If you mean that persist outside the scope of the run of your search, then you need to use outputcsv followed by inputcsv the next time around.

Get Updates on the Splunk Community!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...