Central C must at least have one H, substituent must not be anything else but C, but not a carboxylic acid. Only one of the carbonyle is allowed to be part of the ring.
SMARTS: [#6;!$([#6](-C=O)-C=O):4]-[CH0:1](=[OD1])-[C;H1&!$(C-[*;!#6])&!$(C-C(=O)O),H2:2]-[CH0;R0:3](=[OD1])-[#6;!$([#6](-C=O)-C=O):5].[NH2:6]-[N;!H0;$(N-[#6]),H2:7]>>[C:1]1(-[#6:4])-[C:2]=[C:3](-[#6:5])-[N:7]-[N:6]=1
Conditions
Reactant 1: 1,3-dicarbonyle.
R1, R2: C aromatic or aliphatic, !C=O. R3: H,C, C=O.
References
F. Gosselin, P. D. O'Shea, R. A. Webster, R. A. Reamer, R. D. Tillyer, E. J. J. Grabowski,
Synlett,
2006, 3267-3270.
Other sources
Organic chemistry