If I understand the question properly, we have:
log8x=p
And we wish to express log2x in terms of p.
The first thing we should note is that log8x=xlog8. This follows from the following property of logs:
logab=bloga
Essentially, we can "bring down" the exponent and multiply it by the logarithm. Similarly, using this property on log2x, we get:
log2x=xlog2
Our problem is now boiled down to expressing xlog2 (the simplified form of log2x) in terms of p (which is xlog8). The central thing to realize here is that 8=23; which means xlog8=xlog23. And again using the property described above, xlog23=3xlog2.
We have:
p=xlog23=3xlog2
Expressing xlog2 in terms of p is now drastically easier. If we take the equation p=3xlog2 and divide it by 3, we get:
p3=xlog2
And voila - we have expressed xlog2 in terms of p.