Skip to main content
Solved

Convert Epoch time | TemplateEngine - Render Template

  • Dec 18, 2024 6:07 PM UTC
  • 3 replies
  • 84 views

Forum|alt.badge.img+4

Hi,

Exploring the TemplateEngine action named Render Template.

Trying to convert Epoch time to date and time but not sure how to.

I am getting the Epoch time value from JSON and able to print it through for loop.

But finding it difficult to add the logic in for loop (still learning the coding)

 

Best answer by SoarAndy

Apologies for the image, but it's disagreeing with the forum editor if I paste it in

Obviously swap the integer for your placeholder [Action.thing]

 
Note - Jinja itself uses functions, and not all functions you read on the internet are available in SecOps OOTB.  If you check the IDE you see a file called "JinjaFilters" which includes all the ones we have as of today.  You can (duplicate) and modify "CustomJinjaFilters" if you want to expand this with your own functions.

I can also see 'filter_datetime' which might give you more control on the output

Andy

 

View original

3 replies

SoarAndy
Forum|alt.badge.img+12
  • Bronze 1
  • Answer
  • Dec 20, 2024 2:00 PM UTC

Apologies for the image, but it's disagreeing with the forum editor if I paste it in

Obviously swap the integer for your placeholder [Action.thing]

 
Note - Jinja itself uses functions, and not all functions you read on the internet are available in SecOps OOTB.  If you check the IDE you see a file called "JinjaFilters" which includes all the ones we have as of today.  You can (duplicate) and modify "CustomJinjaFilters" if you want to expand this with your own functions.

I can also see 'filter_datetime' which might give you more control on the output

Andy

 


SoarAndy
Forum|alt.badge.img+12
  • Bronze 1
  • Dec 20, 2024 2:01 PM UTC

Apologies for the image, but it's disagreeing with the forum editor if I paste it in

Obviously swap the integer for your placeholder [Action.thing]

 
Note - Jinja itself uses functions, and not all functions you read on the internet are available in SecOps OOTB.  If you check the IDE you see a file called "JinjaFilters" which includes all the ones we have as of today.  You can (duplicate) and modify "CustomJinjaFilters" if you want to expand this with your own functions.

I can also see 'filter_datetime' which might give you more control on the output

Andy

 


Image of input and ScriptResult output

 


Forum|alt.badge.img+4

Thank you it help now will try to use in for and if loop as well