There is no way that I know of to get that information form within an ingest pipeline.
If you need to know at the cluster level, how many documents each ingest node has processed, you can find that out using the following call.
GET _nodes/stats?filter_path=**.ingest
In the response, you'll get the stats of each ingest pipeline and how many documents each of their processors have processed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…