Splunk Search

Need help in some time conversion

jerinvarghese
Communicator

HI all,

Need help in getting below code adjust to get the value as expected.

index=nw_syslog "DDOS_PROTOCOL_VIOLATION_SET" AND ( "*USDAL*" OR "*USEMC*" OR "*NLACO*" OR "*SGPNH*" OR "*USHCO*" OR "*INMCO*" OR "*CACCO*" OR "*CATRC*" OR "*GBLHD*") ARP
 | stats  latest(_time) as Time_CST count by hostname
  | sort - Time_CST
 | fieldformat Time_CST=strftime(Time_CST,"%x %X")

Current Output

hostname    Time_CST    count
USEMCPOD07-DCNPS3003    02/28/20 06:41:37   3
USEMCPOD07-DCNPS3001    02/28/20 06:41:36   3
USEMCPOD07-DCNPS3002    02/28/20 06:41:36   3
USEMCPOD07-DCNPS3004    02/28/20 06:41:36   2

Expected output.: minus the second.

hostname    Time_CST    count
USEMCPOD07-DCNPS3003    02/28/20 06:41  3
USEMCPOD07-DCNPS3001    02/28/20 06:41  3
USEMCPOD07-DCNPS3002    02/28/20 06:41  3
USEMCPOD07-DCNPS3004    02/28/20 06:41  2
0 Karma
1 Solution

nickhills
Ultra Champion

Hi @jerinvarghese

Use:
strftime(Time_CST,"%m/%d/%y %H:%M")

If my comment helps, please give it a thumbs up!

View solution in original post

0 Karma

nickhills
Ultra Champion

Hi @jerinvarghese

Use:
strftime(Time_CST,"%m/%d/%y %H:%M")

If my comment helps, please give it a thumbs up!
0 Karma

jerinvarghese
Communicator

thanks so much, that worked..

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