Sum aggregation in scripting (Kibana Visualization)

In data table visualization, We have created a new metric with the script as { "script" : "doc['field'].value * 2 " }

Whether the total of this new metric can be found in Kibana using sum aggregation in JSON Input script? Like sum of "doc['field'].value * 2 " to show the total value in the visualization.

How to add sum aggregation in json input?

You shouldn't have to add any custom JSON. The scripted field should show up in the list of fields. Does it not show up for you?