system () is the way to go. :h system().
You can use the old way (the one that gives you full control, since you can direct and redirect as many times as you like):
:let res = system("echo ".shellescape(@+)." | the-filter-command")
:put=res
( ). , , vim :
:let res = system(the-filter-command, @+)
:put=res
, :
:new
:put=@+
:%!the-filter-command
:%d +
:bd
:put=@+
: Vim , :sort, uniq ( ),...