How to write quotes and double quotes in the same String

You can try to format your entries with the json_encode filter :

filter {
  json_encode {
    add_field => { "categorie_svi_field" => "ctx._source['Categorie SVI'] = '%{Categorie SVI}'" }
  }
}

file {
  path => "C:\Users\rtert\Documents\ElasticSearch/sortieSVI.txt"
  codec => line {
    format => '{
      "script": {
        "source": "%{categorie_svi_field}",
        "lang": "painless"
      },
      "query": {
         "term": { "ID Appel SVI.keyword" : "%{ID Appel SVI}" }
      }
    }'
  }
}