Getting Data In

Splunk timeformat issue

uagraw01
Motivator

Hello Splunkers!!

 

I have a below event and I want to parse. But the event is not parsing with time format in Splunk. Please help me to get it fix .

TIME_FORMAT :

%dT%H:%M:%S.%3QZ

TIME_PREFIX :

\<eqtext\:EventTime\>

I have used the above setting but nothings works. StillI can see isse with indexed and event time. Please help me to get it fix.

uagraw01_0-1721015920771.png

 

Below are the raw events:

 

<eqtext:EquipmentEvent xmlns:eqtext="http:///FM/EqtEvent/EqtEventExtTypes/V1/1/5" xmlns:sbt="http://FM/Common/Services/ServicesBaseTypes/V1/8/4" xmlns:eqtexo="http://FM/EqtEvent/EqtEventExtOut/V1/1/5"><eqtext:ID><eqtext:Location><eqtext:PhysicalLocation><AreaID>7053</AreaID><ZoneID>33</ZoneID><EquipmentID>25</EquipmentID><ElementID>0</ElementID></eqtext:PhysicalLocation></eqtext:Location><eqtext:Description> Welder cold</eqtext:Description><eqtext:MIS_Address>6.2</eqtext:MIS_Address></eqtext:ID><eqtext:Detail><State>CAME_IN</State><eqtext:EventTime>2024-07-13T16:21:31.287Z</eqtext:EventTime><eqtext:MsgNr>7751154552301783480</eqtext:MsgNr><Severity>INFO</Severity><eqtext:OperatorID>WALVAU-SCADA-1</eqtext:OperatorID><ErrorType>TECHNICAL</ErrorType></eqtext:Detail></eqtext:EquipmentEvent></eqtexo:EquipmentEventReport>

0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

You might want to set it to a bit higher value. The timestamp is relatively late in the event and the part before the timestamp contains dynamic data which can be of varying length so you have to account for that.

Bonus question - you're not using INDEXED_EXTRACTIONS, are you?

View solution in original post

0 Karma

uagraw01
Motivator

@inventsekar I have added these  three corrected settings in props.conf. I am waiting for the real event to come in, if this works then the job will be done.

LINE_BREAKER = <\/eqtext:EquipmentEvent>()
TIME_PREFIX = ((?<!ReceiverFmInstanceName>))<eqtext:EventTime>
TZ = America/Glace_Bay

0 Karma

uagraw01
Motivator

@inventsekar  I have updated this "TIME_FORMAT = %FT%H:%M:%S.%3Q%Z" other is in #

I have already restarted the Splunkd services.

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi @uagraw01 

|makeresults | eval logs="2024-07-13T16:21:31.287Z" 
| eval time=strptime(logs,"%Y-%m-%dT%H:%M:%S.%Q")
| eval date = strftime(time,"%Y-%m-%d %H:%M:%S") | table logs time date

... pls check "%Y-%m-%dT%H:%M:%S.%Q" timestamp-july15.jpg

yuanliu
SplunkTrust
SplunkTrust

Should be "%FT%H:%M:%S.%3Q%Z".  You can always test your time format with an emulation, like

| makeresults format=csv data="eqtext:EventTime
2024-07-13T16:21:31.287Z"
| eval _time = strptime('eqtext:EventTime', "%FT%H:%M:%S.%3Q%Z")

 

uagraw01
Motivator

@yuanliu @inventsekar  When I ingested to Splunk both the times varies ( index and event time). Please see below screenshot.

uagraw01_0-1721018147234.png

 

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi @uagraw01 pls show us your props.conf 

 

(if you dont know where to find the props....

are you using HF or not... if u use HF, then props.conf should be there

if you dont use HF, then, you should have props.conf for this should be in indexer)

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...