Dashboards & Visualizations

How to fetch string in splunk

aditsss
Motivator

Hi Everyone,

I have below sets of raw logs:

source-timestamp=1655611288414,event-type:Lead_Staging__c

source-timestamp=1655611288414,event-type:Account_Snapshot__c

source-timestamp=1655611288414,event-type:Opp

I want to fetch all the event -type.

Can someone guide me.

 

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

The previous rex worked with the examples you gave - because these examples were incomplete w.r.t. your actual events, it didn't work for your real event.

Assuming that the new examples are an accurate representation of your real events, try this

| rex "event-type:(?<eventType>[^,]+)"

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "event-type:(?<eventType>.+)"
0 Karma

aditsss
Motivator

Hi @ITWhisperer 

 

Its not showing the correct way.

My entire query is this

index=abc ns=blazepsfpublish app_name=pulldataoneforce* "The Total Process Time to publish in Kafka topic is" | rex "event-type:(?<eventType>.+)"| rename eventType as event-type|eval Date=strftime(_time, "%Y-%m-%d") | timechart span=1d count(source_uniqueid) as "The Total Process Time to publish in Kafka topic is" by event-type

I have attached the screenshot to show how it is coming

These are my raw logs

source-uniqueid=cdc3bcb5-9ad4-46a9-92dc-4c84b081ab3b, source-timestamp=1655646610318,event-type:Lead_Staging__c, source-type:OneForce, memsql-persist:true, channel:/event/tel_External_Change_Event__e, replayId:14522702, The Total Process Time to publish in Kafka topic is (milli-sec)=7

Can you please guide

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The previous rex worked with the examples you gave - because these examples were incomplete w.r.t. your actual events, it didn't work for your real event.

Assuming that the new examples are an accurate representation of your real events, try this

| rex "event-type:(?<eventType>[^,]+)"
0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...