Splunk Search

can't extract the field, below error shows up,

simranrathi
New Member

Argument 'value' contains invalid character : ^[\d+;\d+\w+\s+\d+-\d+-\d+\s+\d+:\d+:\d+,\d+\s+[\w+::\w+.\w+.\w+.\w+.\w+.\w+.\w+]\s+[][][\w+\d+][][](\w+)\s+[\w+]\s+\w+\s+\w+\s+\d+\s+\w+\s+[\w+.\w+.\w+.\w+:\s+\w+\s+\w+\s+\w+\s+\w+[\w+:\d+,(?P[^,]+)

I'm trying to run this query to extract fields
index=tomcat (java.sql.SQLException: ORA-12899: value too large for column "NLHYP_USER"."PRODUCTSLP"."P_WASHCARE")
| rex field=message_text "itemPK:\s(?[^\,]+)" | rex field=message_text "langPK:\s(?[^\,]+)"

This field has to be extracted::

[itemPK:8977222991873,langPK:8796093120544,

Tags (2)
0 Karma

simranrathi
New Member

I've tried this
but it is only showing me the results for this particular event
I want more of a generic search to extract all the events' fields

0 Karma

mayurr98
Super Champion

for that, you would need to give me sample data of all such events. No one can give you regex without seeing at the events. Please provide all sample different types of events from which you want to extract these fields.

0 Karma

niketn
Legend

@simranrathi while posting code/data use the code button on Splunk Answers i.e. 101010 or Shortcut Ctrl+K so that special characters do not escape.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

mayurr98
Super Champion

Try this run anywhere search

| makeresults 
| eval message_text="[itemPK:8977222991873,langPK:8796093120544," 
| rex field=message_text "itemPK:(?<itemPK>[^\,]+)\,langPK:(?<langPK>[^\,]+)"

In your environment you should try

index=tomcat (java.sql.SQLException: ORA-12899: value too large for column "NLHYP_USER"."PRODUCTSLP"."P_WASHCARE") 
| rex field=message_text  "itemPK:(?<itemPK>[^\,]+)\,langPK:(?<langPK>[^\,]+)"

let me know if this helps!

Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...