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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...