Splunk Search

How to extract a field using regex at indexing time?

kiran331
Builder

Hi,

I'm ingesting the data in JSON format. we have a field event.user, which is auto extracted. is there a way to extract the new field user from event.user filed at indexing time?

for example:

event.user :
kiran331@SPl,
splunk@ADDS

I need to extract:

user:
kiran331
splunk

0 Karma

kunalmao
Communicator

props.conf at your indexer
[]
REGEX =
FORMAT = ::$1
WRITE_META = [true|false]
DEST_KEY =
DEFAULT_VALUE =
SOURCE_KEY =
REPEAT_MATCH = [true|false]
LOOKAHEAD =

and then bind it to transforms.conf at your indexer

[]
TRANSFORMS- =

for more details you can refer

http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Configureindex-timefieldextraction

0 Karma

kunalmao
Communicator

it removed everything in brackets 😞

0 Karma

mtulett_splunk
Splunk Employee
Splunk Employee

You should be able to edit your answer to update the text. When writing code, put four spaces before each line to convert the text into a code block - this prevents your text from being modified automatically.

0 Karma

ddrillic
Ultra Champion

The following is great - Create custom fields at index time

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...