How do I set an inserter filter based on the contents of a storage tank

Solution 1:

It's simplest to use two inserters, one of which is in "Enable/disable" circuit connection mode, but you can use a single inserter if you use two combinators to program its filter:

Wire the storage tank to the input of a decider combinator, and the output of the decider combinator to the filter inserter. Also connect a constant combinator to the filter inserter.

Screenshot 1

The decider combinator's condition should define when you want barrels to be moved ("Crude oil ≥ 10k") and the output should be the barrel item (make sure it is the correct type of full or empty barrel).

The constant combinator outputs the sulfur item (or any other items you want to be moved unconditionally).

The filter inserter then just needs to be set to “Set filters” circuit connection mode. In this screenshot, the filter was set by circuit, not manually:

Screenshot 2