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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -