In the Satipatthana Sutta, one of the Four Foundations of Mindfulness is “dhammesu dhammānupassī” or “contemplation of dhammas in dhammas.” And one of the ways one does that is through contemplation of the Seven Factors of Awakening, on of which is “dhammavicaya” — the investigation of dhammas! Feeling a little fractal?
“Santaṃ vā ajjhattaṃ dhammavicayasambojjhaṅgaṃ ‘atthi me ajjhattaṃ dhammavicayasambojjhaṅgo’ti pajānāti, asantaṃ vā ajjhattaṃ dhammavicayasambojjhaṅgaṃ ‘natthi me ajjhattaṃ dhammavicayasambojjhaṅgo’ti pajānāti, yathā ca anuppannassa dhammavicayasambojjhaṅgassa uppādo hoti tañca pajānāti, yathā ca uppannassa dhammavicayasambojjhaṅgassa bhāvanāya pāripūrī hoti tañca pajānāti.”
When one inwardly investigates dhammas, one clearly knows, “I am inwardly investigating dhammas,” or when one does not inwardly investigate dhammas, one clearly knows, “I am not inwardly investigating dhammas.” And one clearly knows the arising of unarisen investigation of dhammas, and clearly knows the existence and passing away of dhamma investigation that has arisen.
Mahāsatipaṭṭhānasuttaṃ, Dhammānupassanā Bojjhaṅgapabbaṃ (DN 22.13)