All Apps and Add-ons

Trying to migrate from Splunk DB Connect 1 to DB Connect 2, why is the inputs.py migration script not working?

ejharts2015
Communicator

After following the migration process to migrate from DB Connect 1 to DB Connect 2 located here

  • splunk cmd python dbx_migrate_connections.py - worked
  • splunk cmd python dbx_migrate_lookups.py - worked
  • splunk cmd python dbx_migrate_inputs.py didn't work

Fails silently with no exceptions or outputs.

0 Karma
1 Solution

ejharts2015
Communicator

Answering my own question here, to save folks time and agony in finding a solution.

Our existing database names contain hyphens and underscores (ex. database-things_are-in-dev) which the migration script fails on, to fix edit the following line in

/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/migration/migrations/input/001_migrate_from_dbx1.py

Change this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\w+)/(?P<unique_name>\w+)'

to this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\S+)/(?P<unique_name>\S+)'

Rerun script.

Another note you'll need to manually check your migrated inputs, if you used either:

  • interval = auto
  • interval = 24h

instead of a cron, those will import, but continue to fail until you manually edit them (similar to how you manually edit the lookups).

View solution in original post

ejharts2015
Communicator

Answering my own question here, to save folks time and agony in finding a solution.

Our existing database names contain hyphens and underscores (ex. database-things_are-in-dev) which the migration script fails on, to fix edit the following line in

/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/migration/migrations/input/001_migrate_from_dbx1.py

Change this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\w+)/(?P<unique_name>\w+)'

to this:

name_pattern = r'dbmon-(?P<type>\w+)://(?P<database>\S+)/(?P<unique_name>\S+)'

Rerun script.

Another note you'll need to manually check your migrated inputs, if you used either:

  • interval = auto
  • interval = 24h

instead of a cron, those will import, but continue to fail until you manually edit them (similar to how you manually edit the lookups).

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...