0

For example, in drush I can run

drush cget search_api.server.iges_solr backend_config.connector_config.port

and get a useful answer.

('search_api.server.iges_solr:backend_config.connector_config.port': 8988)

In Drupal Console, I've tried the same formatting as in the drush command, I've tried a colon between the main config item, and the sub item

(drupal dc search_api.server.iges_solr:backend_config.connector_config.port)

I've tried a fair number of other things, and I've read the docs to no avail. Is it possible to do without just grepping?

2

No, Drupal Console doesn't support selecting a key from a configuration object. This is clear from drupal help debug:config which even mention grepping.

Using grep isn't beautiful, but it works:

drupal debug:config system.date | grep -A1 timezone

does return the timezone with the first subkey. (Changing the value after A, you get more lines/the user subkey.)

I would of course prefer to get the configuration object as proper JSON and then pipe it to jq to select a key robustly, but Drupal Console doesn't support an output format option yet - see Github issue.

  • I disagree that it is clear from the docs which is why I asked the question. There are plenty of reasons to use grep on that command besides getting the value for a single key. For example, if you don't know the exact nomenclature of the key you are looking for. Still, this does seem to be the right answer, and I appreciate the hint about grep options. Cheers. – UltraBob Nov 25 '19 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.