elasticsearch - Bash regex find replace -


i have json file lots of timestamps in it. file can contain thousands upoin thousands of timestamps. these timestamps in format dd/mm/yyyy hh:mm:ss.microseconds (6 digits after decimal point).

i trying index these elasticsearch have no idea how in without converting date format miliseconds not microseconds.

how can write in bash can search , replace occurances of dates in format mentioned , replace same timestamp truncated 3 digits rather 6? not sure start.

use sed:

d2='[0-9]\{2\}' sed -e "s=\($d2/$d2/$d2$d2 $d2:$d2:$d2\.[0-9]\{3\}\)[0-9]\{3\}=\1=g" 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -