Error setting up connection to Salesforce

I keep hitting the following error when trying to use the Salesforce module in filebeat against our sandbox environment:
{"function":"github.com/elastic/beats/v7/filebeat/input/v2/compat.(*runner).Start.func1","file.name":"compat/compat.go","file.line":139},"message":"Input 'salesforce' failed with: input login failed: error setting up connection to Salesforce: session response error: 400 400 Bad Request","service.name":"filebeat","id":"login","ecs.version":"1.6.0"}
I believe I've set up the Connected App correctly:

salesforce.yml has the following:

  login:
    enabled: true
    var.initial_interval: 1d
    var.api_version: 61

    var.authentication:
      user_password_flow:
        enabled: true
        client.id: '${SF_CLIENT_ID}'
        client.secret: '${SF_CLIENT_SECRET}'
        token_url: '${SF_TOKEN_URL}'
        username: '${SF_USERNAME}'
        password: '${SF_PASSWORD}'
      jwt_bearer_flow:
        enabled: false

    var.url: '${SF_URL}'

    var.event_log_file: true
    var.elf_interval: 1h
    var.log_file_interval: 'Hourly'

    var.real_time: true
    var.real_time_interval: 5m

I believe the values for the above are correct, with the exception of var.url and var.authentication.user_password_flow.token_url. It's unclear if these should be https://test.salesforce.com of the instance URL (which I assume could either be the "classic" url or the "lightning" one. Hopefully someone has managed to set this up. Full disclosure, I know nothing about SF.

Thanks,
Dave