This tutorial shows how to use Expression and Script Controllers to control flare intensity dependent on distance from camera. Open your scene, I guess you already have the camera and a flare linked to object. In my example it will be Camera01 and Omni01 as flare node. After you add Lens Effect Flare in Video Post queue, it becomes available in Track View. Open the Track View, expand Video Post/Lens Effect Flare/Intensity track. You can also control any other track in the way showed below.
Select the Intensity track in Track View, click Assign Controller icon, choose Float Expression and click OK. Now click the Properties icon or right click on track's name and choose Properties. Expression setup window will appear.

Now we will create the expression. First define two vector variables. Call it ie. camera and flare. To create the variable just type it's name, select type: vector and click Create. Both variables will appear on Vectors list. Now click on flare and click Assign to Controller button. Track view picker will appear, expand object branch, find your flare node object, expand its transforms and choose position, click ok. Do the same with camera vector, of course point the picker to camera object position. Now thru these variables we can access objects' position inside the expression.

Now it is time to write the math expression that will output controller's value. We want out flare to be less and less intense while it is farther from camera. Distance between object can be measured by simple function:
length(camera-flare)
But let's say we don't want linear intensity change, lets make it logarithmic. Something like on the graph below. We will use the square root function:
sqrt(length(camera-flare))
Finally we need to decrease intensity while the distance is bigger, not increase. So the final expression will be:
100-sqrt(length(camera-flare))*3
Our expression's graph will look like this:

I added *3 multiplier to make the complete fade distance about 1000 units. If you want your flare to fade completelly in n units use this formula to calculate the multiplier:
multiplier=100/sqrt(distance)
So, the expression is ready, configured expression window is showed below:

Actually writing a script controller is very similar to previously made expression, but setting it up is much easier. In the begining instead of choosing Float Expression pick Float Script.
close_int = 100
To make the controller easier to read and modify let's define a few variables:
cam_pos = $camera01.position
flare_pos = $omni01.position
dist = distance cam_pos flare_pos
fade_dist = 1000
multiplier = close_int/sqrt(fade_dist)
And all we have to do now is computing the output intensity value:
i = close_int - sqrt(dist) * multiplier
This can seem a bit long, but you can't really make a controller easier to adjust in future. If you want to change maximum intensity, just change close_int initial value, maximum fade is defined by fade_dist, and node objects are defined by $object_name.position.

Remember that script controller is not as interactive as expression controller, it is updated only while you move the time slider.