Getting Data In

How to set a string in my current source field value as the source in Splunk?

harishnpandey
Explorer

Hi ,

Is there any way I can simply have Plprdfinodm01 as my Source in Splunk which indicates JVM name?

D:\splunk\was\vxpip-ppm01\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm02\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm02\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm01\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm02\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm02\PIprdfinodm01\messages.log    
D:\splunk\was\vxpip-ppm01\PIprdfinodm01\messages.log
D:\splunk\waslp\vxpip-ppm02\PIprdfinodm01\messages.log

alt text

0 Karma

livehybrid
Builder

Or..you could overwrite the source...

If your sourcetype was called "jvm-log", you'd have a props.conf entry for the sourcetype, identifying the transform rule.

 [jvm-log]
 TRANSFORMS-1_source = force_jvm_source

This references a rule that would be defined in transforms.conf:

 [force_jvm_source]
 SOURCE_KEY =_raw
 REGEX =.*\\([^\\]+)\\messages.log
 DEST_KEY = MetaData:Source
 FORMAT = source::$1
0 Karma

livehybrid
Builder

I think personally I would create a new field (field extraction) called something like JVMHost. That way you preserve the original data.
You could use a regex like this:
.*\\(?<JVMHost>[^\\]+)\\messages.log

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