you can do something like this works for all datatable version
what we are doing here is tracking the search input field and then getting its value only
no need to use datatable api using this method
$('input[type="search"]').on( 'keyup', function () {
console.log($(this).val());
} );